#include <bits/stdc++.h>
using namespace std;
const int maxn = 100050;
int x[maxn], y[maxn];
int n;
bool check(long double R) {
  long double x0 = -1e18;
  long double y0 = R;
  for (int i = 1; i <= n; ++i) {
    if (y[i] < 0) y0 = -R;
  }
  for (int i = 1; i <= n; ++i) {
    long double d = y[i] - y0;
    if (d > R) return false;
    long double t = sqrtl(R * R - d * d);
    x0 = max(x0, (long double)x[i] - t);
  }
  for (int i = 1; i <= n; ++i) {
    long double d = (long double)(y[i] - y0) * (y[i] - y0) +
                    (long double)(x0 - x[i]) * (x0 - x[i]);
    if (sqrtl(d) - R > 1e-7) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  bool f = false, fn = false;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", x + i, y + i);
    if (y[i] < 0)
      fn = true;
    else if (y[i])
      f = true;
  }
  if (f && fn) {
    cout << -1 << endl;
    return 0;
  }
  long double l = 0, r = 1e15, ans = -1;
  if (!check(r)) {
    cout << -1 << endl;
    return 0;
  }
  while (fabsl(r - l) / r >= 1e-12) {
    long double mid = (l + r) / 2;
    if (check(mid))
      ans = mid, r = mid;
    else
      l = mid;
  }
  printf("%.9Lf\n", ans);
  return 0;
}
