#include <bits/stdc++.h>
using namespace std;
const int N = 112345;
long long x[N], y[N];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld", x + i, y + i);
  }
  bool pos = false, neg = false;
  for (int i = 0; i < n; i++) {
    if (y[i] > 0) pos = true;
    if (y[i] < 0) neg = true;
  }
  if (pos and neg) {
    printf("-1\n");
    return 0;
  }
  long double lo = 0, hi = 101234567800000.0;
  if (pos) {
    for (int it = 100; it >= 0; it--) {
      long double raio = (lo + hi) / 2.;
      long double l = -1123456789.0, r = 1123456789.0;
      bool f = true;
      for (int i = 0; i < n; i++) {
        long double c = (y[i] * y[i]) - 2 * y[i] * raio + x[i] * x[i];
        long double a = 1;
        long double b = -2 * x[i];
        long double delta = b * b - 4 * a * c;
        if (delta < 0) {
          f = false;
          break;
        } else {
          delta = sqrt(max((long double)0., delta));
          long double x1 = (-b - delta) / (2 * a);
          long double x2 = (-b + delta) / (2 * a);
          if (x1 > x2) swap(x1, x2);
          l = max(l, x1);
          r = min(r, x2);
        }
      }
      if (!f) {
        lo = raio;
        continue;
      }
      if (l <= r) {
        hi = raio;
      } else
        lo = raio;
    }
  } else {
    for (int it = 100; it >= 0; it--) {
      long double raio = (lo + hi) / 2.;
      long double l = -1123456789.0, r = 1123456789.0;
      bool f = true;
      for (int i = 0; i < n; i++) {
        long double c = (y[i] * y[i]) + 2 * y[i] * raio + x[i] * x[i];
        long double a = 1;
        long double b = -2 * x[i];
        long double delta = b * b - 4 * a * c;
        if (delta < 0) {
          f = false;
        } else {
          delta = sqrt(max((long double)0., delta));
          long double x1 = (-b - delta) / (2 * a);
          long double x2 = (-b + delta) / (2 * a);
          if (x1 > x2) swap(x1, x2);
          l = max(l, x1);
          r = min(r, x2);
        }
      }
      if (!f) {
        lo = raio;
        continue;
      }
      if (l <= r) {
        hi = raio;
      } else
        lo = raio;
    }
  }
  printf("%.12Lf\n", hi);
  return 0;
}
