#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& cout, const vector<T>& a) {
  cout << "[";
  if (((int)a.size())) cout << a[0];
  for (int i = 0; i++ < ((int)a.size()) - 1;) cout << ", " << a[i];
  return cout << "]";
}
template <typename u, typename v>
ostream& operator<<(ostream& cout, const pair<u, v>& a) {
  return cout << "(" << a.first << ", " << a.second << ")";
}
int n;
pair<long double, long double> a[101010];
bool ok(long double r) {
  long double minr = -1e30, maxr = 1e30;
  for (int i = -1; ++i < n;) {
    if (a[i].second > 2 * r) return false;
    long double l = sqrt(a[i].second * (2 * r - a[i].second));
    long double mi = a[i].first - l, ma = a[i].first + l;
    if (mi > maxr || ma < minr) return false;
    minr = max(minr, mi);
    maxr = min(maxr, ma);
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  bool hasl = 0, hasr = 0;
  for (int i = -1; ++i < n;) {
    cin >> a[i].first >> a[i].second;
    (a[i].second < 0 ? hasl : hasr) = 1;
    if (a[i].second < 0) a[i].second = -a[i].second;
  }
  if (hasr and hasl) {
    cout << -1;
    return 0;
  }
  long double l = 0, r = 1;
  while (!ok(r)) r *= 2.0;
  for (int _ = -1; ++_ < 200;) {
    long double mid = (l + r) / 2;
    if (ok(mid))
      r = mid;
    else
      l = mid;
  }
  cout << fixed << setprecision(10) << l;
  return 0;
}
