#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int n, x[100005], y[100005];
bool f1, f2;
bool check(double d) {
  double L = -1e18, R = 1e18;
  for (int i = 1; i <= n; i++) {
    if (2.0 * d < y[i]) return false;
    double dis = sqrt((2.0 * d - y[i]) * y[i]);
    L = max(L, x[i] - dis), R = min(R, x[i] + dis);
  }
  return L <= R;
}
signed main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x[i], &y[i]);
    if (y[i] > 0) f1 = 1;
    if (y[i] < 0) f2 = 1;
  }
  if (f1 && f2) {
    puts("-1");
    return 0;
  }
  if (f2)
    for (int i = 1; i <= n; i++) y[i] = -y[i];
  int ti = 500;
  double l = 0, r = 1e14 + 10, ans;
  while (ti--) {
    double mid = (l + r) / 2.0;
    if (check(mid))
      ans = mid, r = mid;
    else
      l = mid;
  }
  printf("%.6lf", ans);
  return 0;
}
