#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int N = 1e5 + 5;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
struct point {
  double x, y;
} p[N];
bool check(double);
int n;
int main() {
  scanf("%d", &n);
  int ok = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    if (p[i].y < 0) ok |= 1;
    if (p[i].y > 0) ok |= 2;
    p[i].y = fabs(p[i].y);
  }
  if (3 == ok) {
    printf("-1");
    return 0;
  }
  double l = 0, r = 1e18, mid;
  for (int i = 0; i < 500; i++) {
    mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.10f", l);
}
bool check(double mid) {
  double l = -1e18, r = 1e18;
  for (int i = 1; i <= n; i++) {
    if (p[i].y > 2 * mid) return 0;
    double t = sqrt(p[i].y) * sqrt(mid + mid - p[i].y);
    l = max(l, p[i].x - t), r = min(r, p[i].x + t);
  }
  return l < r;
}
