#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long double eps = 1e-10;
int n;
int x[N][2];
bool ypos, yneg;
bool V(long double r) {
  long double lo = -1e18, hi = 1e18;
  for (int i = 0; i < n; i++) {
    if (abs(x[i][1] - r) > r) return false;
    long double dist = sqrt(2 * r * x[i][1] - pow(x[i][1], 2));
    lo = max(lo, x[i][0] - dist);
    hi = min(hi, x[i][0] + dist);
  }
  if (hi - lo >= 0) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.precision(17);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i][0] >> x[i][1];
  ypos = yneg = false;
  for (int i = 0; i < n; i++)
    if (x[i][1] > 0) {
      ypos = true;
    } else {
      yneg = true;
      x[i][1] *= -1;
    }
  if (ypos && yneg) {
    cout << -1 << endl;
    return 0;
  }
  long double h = 1e18, l = 0;
  for (int i = 0; i < 500; i++) {
    long double r = (h + l) / 2.0;
    bool xx = V(r);
    if (xx)
      h = r;
    else
      l = r;
  }
  cout << h << endl;
  return 0;
}
