#include <bits/stdc++.h>
using namespace std;
const double e = 1e-7;
const int N = 1e5 + 10;
double x[N], y[N];
int n;
bool check(double rr) {
  double r2 = rr * rr;
  double l = -1e16, r = 1e16;
  for (int i = 0; i < n; i++) {
    double tt = sqrt(y[i] * rr * 2 - y[i] * y[i]);
    l = max(l, x[i] - tt);
    r = min(r, x[i] + tt);
    if (l > r) {
      return false;
    }
  }
  return true;
}
int main() {
  cin >> n;
  bool nn = false, pp = false;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (y[i] > 0) pp = true;
    if (y[i] < 0) nn = true;
  }
  if (nn && pp) {
    cout << -1 << endl;
    return 0;
  }
  if (nn)
    for (int i = 0; i < n; i++) y[i] = -y[i];
  double l = 0, r = 1e16;
  for (int i = 0; i < n; i++) l = max(l, y[i]);
  l /= 2;
  int cnt = 120;
  while (l < r && cnt--) {
    double mid = (r + l) / 2.0;
    if (check(mid))
      r = mid - e;
    else
      l = mid + e;
  }
  cout << fixed << l << endl;
}
