#include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 1e5 + 10;
const long double eps = 1e-8;
long double x[MAXN], y[MAXN];
int dcmp(long double x) {
  if (fabs(x) < eps)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
long double fun(long double xx) {
  long double res = 0;
  for (int i = 1; i <= n; i++) {
    long double w1 = fabsl(y[i]) / 2;
    long double w2 = fabsl(xx - x[i]) / 2;
    long double yy = w1 + w2 * w2 / w1;
    res = max(res, yy);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    if (y[i] > 0) cnt2++;
    if (y[i] < 0) y[i] = -y[i], cnt1++;
  }
  if (cnt1 && cnt2) {
    cout << -1 << endl;
    return 0;
  }
  long double ans = 1e8;
  long double l = -1e8, r = 1e8;
  for (int i = 1; i <= 100; i++) {
    long double mid = l + (r - l) / 3;
    long double midd = r - (r - l) / 3;
    long double w1 = fun(mid);
    long double w2 = fun(midd);
    if (w1 < w2) {
      ans = w1;
      r = midd;
    } else {
      ans = w2;
      l = mid;
    }
  }
  printf("%.10Lf", ans);
  return 0;
}
