#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100010;
const double EPS = 1e-9;
const double INF = 1e15;
int N;
double pt[MAXN][2];
bool fits(double R) {
  double l = -INF, r = INF;
  double dx, dy;
  for (int i = 0; i < N; i++) {
    if (2 * R < pt[i][1] - EPS) return false;
    dy = fabs(R - pt[i][1]);
    dx = sqrt(R * R - dy * dy);
    l = max(l, pt[i][0] - dx);
    r = min(r, pt[i][0] + dx);
  }
  return r - l > -EPS;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N;
  int t = -1;
  for (int i = 0; i < N; i++) {
    cin >> pt[i][0] >> pt[i][1];
    if (t == -1) {
      t = pt[i][1] < 0;
    } else if (t != (pt[i][1] < 0)) {
      cout << "-1\n";
      return 0;
    }
    if (pt[i][1] < 0) pt[i][1] *= -1;
  }
  double a = .5, b = 1e14, c;
  while (b / a > 1 + EPS) {
    c = (a + b) / 2;
    if (fits(c)) {
      b = c;
    } else {
      a = c;
    }
  }
  cout.precision(12);
  cout << a << "\n";
}
