#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
const long double oo = 1e18;
int n, minRad, x[N], y[N];
bool pos, neg;
bool valid(long double r) {
  long double L = -oo, R = oo;
  for (int i = 0; i < n; ++i) {
    long double h = fabs(r - y[i]);
    long double d = r * cos(asin(h / r));
    L = max(L, x[i] - d);
    R = min(R, x[i] + d);
  }
  return L <= R;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", x + i, y + i);
    pos |= (y[i] > 0);
    neg |= (y[i] < 0);
    y[i] = abs(y[i]);
    minRad = max(minRad, y[i]);
  }
  if (pos && neg) {
    return cout << -1, 0;
  }
  long double l = minRad / 2.0, r = 1e15;
  for (int i = 0; i < 100; ++i) {
    long double mid = (l + r) / 2;
    if (valid(mid))
      r = mid;
    else
      l = mid;
  }
  cout << fixed << setprecision(15) << r;
  return 0;
}
