#include <bits/stdc++.h>
using namespace std;
const int maxN = 100000 + 10;
bool flag1 = false, flag2 = false;
struct Point {
  double x, y;
} a[maxN];
int n;
bool judge(double ans) {
  if (a[0].y > 2.0 * ans) return false;
  double le = a[0].x - sqrt(a[0].y * (2.0 * ans - a[0].y));
  double ri = a[0].x + sqrt(a[0].y * (2.0 * ans - a[0].y));
  for (int i = 1; i < n; i++) {
    if (a[i].y > 2.0 * ans) return false;
    le = max(le, a[i].x - sqrt(a[i].y * (2.0 * ans - a[i].y)));
    ri = min(ri, a[i].x + sqrt(a[i].y * (2.0 * ans - a[i].y)));
    if (ri < le) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf %lf", &a[i].x, &a[i].y);
    if (a[i].y > 0) flag1 = 1;
    if (a[i].y < 0) flag2 = 1;
    if (a[i].y < 0) a[i].y = -a[i].y;
  }
  if (flag1 && flag2) {
    puts("-1");
    return 0;
  }
  double l = 0, r = 5e13 + 1e3;
  int t = 200;
  while (r - l > 1e-6 && t--) {
    double mid = (l + r) / 2.0;
    if (judge(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.7lf\n", l);
  return 0;
}
