#include <bits/stdc++.h>
using namespace std;
struct node {
  double x, y;
} p[100005];
int n;
int check(double R) {
  double l = -1e18, r = 1e18;
  for (int i = 1; i <= n; i++) {
    if (2 * R < p[i].y) return 0;
    double len = sqrt(R - (R - p[i].y)) * sqrt(R + (R - p[i].y));
    l = max(l, p[i].x - len);
    r = min(r, p[i].x + len);
  }
  return l < r;
}
int main() {
  scanf("%d", &n);
  double mx = -1e7 - 1, mn = 1e7 + 1;
  for (int i = 1; i <= n; i++) {
    scanf("%lf %lf", &p[i].x, &p[i].y);
    mx = max(mx, p[i].y);
    mn = min(mn, p[i].y);
    if (p[i].y < 0) p[i].y = -p[i].y;
  }
  if (mx > 0 && mn < 0) {
    printf("-1\n");
  } else {
    double l = 0, r = 1e14, res = 0;
    for (int i = 1; i <= 200; i++) {
      double mid = (l + r) / (2.0);
      if (check(mid)) {
        res = mid;
        r = mid;
      } else {
        l = mid;
      }
    }
    printf("%.12f\n", res);
  }
  return 0;
}
