#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
pair<long double, long double> point[N];
long double check(long double x, long long n) {
  long double r = 0;
  for (long long i = 0; i < n; i++) {
    long double r1 =
        ((point[i].first - x) * (point[i].first - x) / point[i].second +
         point[i].second) *
        0.5;
    r = max(r, r1);
  }
  return r;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long pos = 0, neg = 0;
  for (long long i = 0; i < n; i++) {
    cin >> point[i].first >> point[i].second;
    if (point[i].second <= 0) {
      point[i].second *= -1;
      neg = 1;
    } else
      pos = 1;
  }
  if (pos and neg) {
    cout << -1 << '\n';
    return 0;
  }
  long double l = -1e7 - 5, r = 1e7 + 5, eps = 1e-12;
  while (r - l > eps) {
    long double m1 = l + (r - l) / 3.0;
    long double m2 = r - (r - l) / 3.0;
    if (check(m1, n) > check(m2, n))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(12);
  cout << check(l, n) << '\n';
}
