#include <bits/stdc++.h>
using namespace std;
struct node {
  long double x, y;
} nod[100000 + 10];
int n;
const long double eps = 1e-10;
long double f(long double x) {
  long double r = 0;
  for (int i = 0; i < n; i++) {
    long double xx = ((nod[i].x - x) * (nod[i].x - x) + (nod[i].y * nod[i].y));
    xx /= nod[i].y;
    xx /= 2.0;
    r = max(xx, r);
  }
  return r;
}
const long double h1 = (3.0 - sqrt(5)) / 2.0;
const long double h2 = (sqrt(5) - 1.0) / 2.0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> nod[i].x >> nod[i].y;
  }
  int zheng = 0;
  int fu = 0;
  for (int i = 0; i < n; i++) {
    if (nod[i].y > 0)
      zheng++;
    else
      fu++;
  }
  if (min(zheng, fu) >= 1) {
    printf("-1\n");
    return 0;
  }
  if (zheng == 0) {
    for (int i = 0; i < n; i++) {
      nod[i].y = -1.0 * nod[i].y;
    }
  }
  long double l, r, mid1, mid2;
  l = -100000000.0;
  r = 100000000.0;
  for (int i = 0; i < n; i++) {
    l = min(l, nod[i].x);
    r = max(r, nod[i].x);
  }
  while (r - l > eps) {
    mid1 = l + h1 * (r - l);
    mid2 = r - h1 * (r - l);
    if (f(mid2) < f(mid1)) {
      l = mid1;
    } else {
      r = mid2;
    }
  }
  printf("%.11Lf\n", f(r));
}
