#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const double eps = 1e-8;
int n;
int x[maxn], y[maxn];
bool check(double k) {
  double pl = -1e7, pr = 1e7;
  for (int i = 1; i <= n; i++) {
    double tmp = 2.0 * k * y[i] - 1.0 * y[i] * y[i];
    if (tmp < eps) return 0;
    double l = x[i] - sqrt(tmp), r = x[i] + sqrt(tmp);
    if (l - pr > eps || pl - r > eps) return 0;
    pl = max(pl, l), pr = min(r, pr);
  }
  return 1;
}
int main() {
  int f1 = 0, f2 = 0, f3 = 0, p;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    if (y[i] > 0)
      f1++;
    else if (y[i] < 0)
      f2++;
    else
      f3++, p = x[i];
  }
  if (f3 > 1 || (f1 > 0 && f2 > 0)) {
    printf("-1");
    return 0;
  }
  if (f2)
    for (int i = 1; i <= n; i++) y[i] = -y[i];
  if (f3 == 1) {
    double ans = 0;
    for (int i = 1; i <= n; i++)
      if (y[i])
        ans = max(ans, 1.0 * y[i] / 2 + (1.0 * x[i] - p) * (1.0 * x[i] - p) /
                                            2 / (1.0 * y[i]));
    printf("%.6lf", ans);
    return 0;
  }
  double l = 0, r = 1e15;
  int cnt = 0;
  while (r - l > eps) {
    cnt++;
    if (cnt >= 100) break;
    double mid = (l + r) / 2.0;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.6lf", r);
  return 0;
}
