#include <bits/stdc++.h>
using namespace std;
int cn[4];
long double x[100100], y[100100];
int sign(long double &v) {
  if (v > 0) return 1;
  if (v < 0) return 2;
  return 0;
}
int main() {
  int n;
  cin >> n;
  long double low = 0.0, high = 1e18;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    cn[sign(y[i])]++;
    if (y[i] < 0) y[i] *= -1;
    low = max(low, 0.5 * y[i]);
  }
  if (cn[1] && cn[2] || cn[0] > 1) return !printf("-1\n");
  for (int it = 0; it < 100; it++) {
    long double mid = 0.5 * (high + low);
    long double mxl = -1e18, mnr = 1e18;
    for (int i = 0; i < n; i++) {
      double del = sqrtl((high + low) - y[i]) * sqrtl(y[i]);
      mxl = max(mxl, x[i] - del);
      mnr = min(mnr, x[i] + del);
    }
    if (mxl <= mnr)
      high = mid;
    else
      low = mid;
  }
  cout << fixed << setprecision(12) << high << endl;
  return 0;
}
