#include <bits/stdc++.h>
using namespace std;
struct aaa {
  double x, y;
} a[200001];
int n, ze, fu;
double ans;
int pd(double mid) {
  int i;
  double t, mx = -1e17, mn = 1e17;
  for (i = 1; i <= n; i++) {
    t = a[i].y * (mid * 2 - a[i].y);
    if (t < 0) return 0;
    t = sqrt(t);
    mx = max(mx, a[i].x - t);
    mn = min(mn, a[i].x + t);
  }
  return mx <= mn;
}
int main() {
  int i;
  double l, r, mid;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf%lf", &a[i].x, &a[i].y);
    if (a[i].y > 0) ze = 1;
    if (a[i].y < 0) fu = 1;
    a[i].y = abs(a[i].y);
  }
  l = 0;
  r = 1e15;
  ans = r;
  if (ze && fu || !pd(r)) {
    puts("-1");
    return 0;
  }
  while (abs(l - r) / max(1.0, l) > 1e-8) {
    mid = (l + r) / 2;
    if (pd(mid)) {
      ans = min(ans, mid);
      r = mid;
    } else
      l = mid;
  }
  printf("%.7lf", ans);
}
