#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> a;
bool check(long double r, long long n) {
  long double st = -1e15;
  long double en = 1e15 + 5;
  for (long long i = 0; i < n; i++) {
    long double b = -2 * a[i].first;
    long double d =
        b * b - 4 * (a[i].first * a[i].first + a[i].second * a[i].second -
                     2 * a[i].second * r);
    if (d < 0 + 1e-9) return false;
    d = sqrt(d);
    long double x1 = a[i].first - d / 2;
    long double x2 = a[i].first + d / 2;
    st = max(x1, st);
    en = min(en, x2);
  }
  return !(st > en + 1e-9);
}
int main() {
  long long n;
  cin >> n;
  bool neg = false, pos = false;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    a.push_back(make_pair(x, y));
    if (y < 0) neg = true;
    if (y > 0) pos = true;
  }
  if (neg && pos) {
    cout << "-1";
    return 0;
  }
  if (neg) {
    for (long long i = 0; i < n; i++) a[i].second = -a[i].second;
  }
  long double l = 0.0;
  long double r = 1e16;
  if (check(1, n))
    r = 1;
  else
    l = 1;
  for (long long i = 0; i <= 200; i++) {
    long double mid = (l + r) / 2.0;
    if (check(mid, n))
      r = mid;
    else
      l = mid;
  }
  cout.precision(16);
  cout << fixed << (r + l) / 2.0;
}
