#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
struct point {
  double x, y;
} p[N];
long long n;
bool check(double r) {
  double mn = 1e38, mx = -1e38;
  for (long long i = 1; i <= n; i++) {
    if (r * r - (p[i].y - r) * (p[i].y - r) < -1e-9) return false;
    double d = sqrt(r * r - (p[i].y - r) * (p[i].y - r));
    mn = min(mn, p[i].x + d);
    mx = max(mx, p[i].x - d);
  }
  return mn - mx >= -1e-9;
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> p[i].x >> p[i].y;
  double mx = 0;
  for (long long i = 1; i <= n; i++)
    mx = max(mx, max(abs(p[i].x), abs(p[i].y)));
  double ymn = 1e18, ymx = -1e18;
  for (long long i = 1; i <= n; i++)
    ymn = min(ymn, p[i].y), ymx = max(ymx, p[i].y);
  if (ymn < 0 && ymx > 0) {
    cout << -1 << endl;
    return 0;
  }
  for (long long i = 1; i <= n; i++) p[i].y = abs(p[i].y);
  double l = 0, r = mx * mx * 10;
  while (r - l > 1e-8 && (r - l) / r > 1e-10) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (r > mx * mx * 5) {
    cout << -1 << endl;
  } else {
    printf("%.10lf\n", r);
  }
}
