#include <bits/stdc++.h>
using namespace std;
long long n, by, ay;
double mxy, l, r, m, D, x1[100005], x2[100005], x[100005], y[100005], mx1, mx2;
bool b;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (y[i] > 0) ay = 1;
    if (y[i] < 0) by = 1;
    y[i] = abs(y[i]);
    mxy = max(mxy, y[i]);
  }
  if (ay + by == 2) {
    cout << -1 << endl;
    return 0;
  }
  l = mxy / 2;
  r = 1000000000000003;
  for (int w = 0; w < 200; w++) {
    b = 0;
    mx1 = -1000000000000000;
    mx2 = 1000000000000000;
    m = (l + r) / 2;
    for (int i = 0; i < n; i++) {
      D = 2 * m * y[i] - y[i] * y[i];
      if (D < 0) {
        b = 1;
        break;
      }
      x1[i] = x[i] - sqrt(D);
      x2[i] = x[i] + sqrt(D);
      mx1 = max(mx1, x1[i]);
      mx2 = min(mx2, x2[i]);
    }
    if (mx1 > mx2 || b)
      l = m;
    else
      r = m;
  }
  printf("%f", l);
  return 0;
}
