#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
using namespace std;
const int mod = 1e9 + 7;
struct per {
  double x, y;
} p[100006];
int n;
int check(double y) {
  double l = -1e18, r = 1e18;
  for (int i = 0; i < n; i++) {
    if (2 * y < p[i].y) return 0;
    double len = sqrt(y - (y - p[i].y)) * sqrt(y + (y - p[i].y));
    l = max(l, p[i].x - len);
    r = min(r, p[i].x + len);
  }
  return l < r;
}
int main() {
  int t, flag1 = 0, flag2 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    if (p[i].y >= 0) {
      flag1 = 1;
    } else {
      flag2 = 1;
    }
    if (p[i].y < 0) {
      p[i].y = fabs(p[i].y);
    }
  }
  if (flag1 + flag2 == 2) {
    printf("-1\n");
    return 0;
  }
  double l = 0, r = 1e18, ans = 0;
  for (int i = 1; i <= 500; i++) {
    double m = (l + r) / 2;
    if (check(m))
      ans = r = m;
    else
      l = m;
  }
  printf("%.7lf\n", ans);
  return 0;
}
