#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MAX = 1e6 + 5;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
struct point {
  double x, y;
} p[MAX];
int n;
long double calcu(long double x) {
  long double r = 0;
  for (int i = 0; i < n; i++) {
    r = max(r, (x - p[i].x) * (x - p[i].x) / p[i].y / 2 + p[i].y / 2);
  }
  return r;
}
int main() {
  cin >> n;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    if (p[i].y > 0) flag |= 1;
    if (p[i].y < 0) flag |= 2;
    p[i].y = fabs(p[i].y);
  }
  if (flag == 3) {
    printf("-1\n");
    return 0;
  }
  long double l = -1e7, r = 1e7, lx, rx, dx;
  while (r - l > eps) {
    dx = (r - l) / 3.0;
    lx = l + dx;
    rx = r - dx;
    if (calcu(lx) - calcu(rx) < 0)
      r = rx;
    else
      l = lx;
  }
  printf("%.8f\n", (double)calcu(r));
  return 0;
}
