#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 20;
int n;
double x[maxn];
double y[maxn];
int ok(double r) {
  double xleft = -1e15, xright = 1e15, tmp;
  for (int i = 1; i <= n; i++) {
    if (y[i] > 2 * r) return 0;
    tmp = sqrt(2 * r * y[i] - y[i] * y[i]);
    xleft = max(xleft, x[i] - tmp);
    xright = min(xright, x[i] + tmp);
  }
  return xleft <= xright;
}
int main() {
  int xcnt = 0;
  int yup = 0;
  int ydown = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &x[i], &y[i]);
    if (y[i] == 0) xcnt++;
    if (y[i] > 0) yup = 1;
    if (y[i] < 0) ydown = 1, y[i] = -y[i];
  }
  if ((yup && ydown) || (xcnt >= 2))
    printf("-1\n");
  else {
    int cnt = 100;
    double l = 0, r = 1e15, mid, ans;
    while (cnt--) {
      mid = (l + r) / 2.0;
      if (ok(mid)) {
        ans = mid;
        r = mid;
      } else
        l = mid;
    }
    printf("%.6lf\n", ans);
  }
  return 0;
}
