#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(T a) {
  for (auto x : a) cout << x << " ";
  cout << endl;
}
const string DIGITS = "0123456789";
int n;
const int N = 1e5 + 9;
pair<long long, long long> points[N];
const long double oo = 5e9;
const long double EPS = 1e-9;
bool check(long double r) {
  long double lft = -oo, rft = oo;
  for (int i = 0; i < n; ++i) {
    if ((long double)points[i].second > 2.0 * r &&
        abs((long double)points[i].second - 2.0 * r) > EPS)
      return false;
    long double a = abs((long double)points[i].second - r);
    long double b = sqrt(r - a) * (long double)sqrt(r + a);
    lft = max(lft, ((long double)points[i].first - b));
    rft = min(rft, ((long double)points[i].first + b));
  }
  return rft - lft > -EPS;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  bool neg = false;
  bool pos = false;
  for (int i = 0; i < n; ++i) {
    cin >> points[i].first >> points[i].second;
    neg |= points[i].second > 0;
    pos |= points[i].second < 0;
    points[i].second = abs(points[i].second);
  }
  if (neg && pos) {
    cout << "-1";
    return 0;
  }
  long double l = 0, r = 1e16;
  for (int iter = 0; iter < 600; ++iter) {
    long double m = (l + r) / 2.0;
    if (check(m))
      r = m;
    else
      l = m;
  }
  cout << setprecision(7) << fixed << (r + l) / 2.0;
}
