#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const double eps = 1e-8;
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
} a[N];
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
bool check(double m, int n) {
  pair<double, double> ans = pair<double, double>(-1e18, 1e18);
  for (int i = 1; i <= n; i++) {
    if (dcmp(2 * m - a[i].y) < 0) return 0;
    double d = sqrt(2 * m - a[i].y) * sqrt(a[i].y);
    pair<double, double> tmp = pair<double, double>(a[i].x - d, a[i].x + d);
    ans.first = max(ans.first, tmp.first);
    ans.second = min(ans.second, tmp.second);
  }
  return dcmp(ans.second - ans.first) >= 0;
}
void solve() {
  int n;
  scanf("%d", &n);
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &a[i].x, &a[i].y);
    if (dcmp(a[i].y) < 0)
      flag |= 1;
    else
      flag |= 2;
  }
  if (flag == 3)
    printf("-1\n");
  else {
    for (int i = 1; i <= n; i++) a[i].y = fabs(a[i].y);
    double l = 0, r = 1e14;
    for (int i = 0; i < 200; i++) {
      double m = (l + r) / 2;
      if (check(m, n))
        r = m;
      else
        l = m;
    }
    printf("%.8f\n", l);
  }
}
int main() {
  solve();
  return 0;
}
