#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const double eps = 1e-7;
int n;
double x[maxn], y[maxn];
bool check(double R) {
  double l = -1e18, r = 1e18;
  for (int i = 1; i <= (int)(n); ++i) {
    if (y[i] > 2.0 * R) return false;
    double delta = sqrt(2.0 * R - y[i]) * sqrt(y[i]);
    double ll = x[i] - delta, rr = x[i] + delta;
    r = min(rr, r);
    l = max(ll, l);
    if (r < l) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  int u = 0, d = 0, z = 0;
  for (int i = 1; i <= (int)(n); ++i) {
    cin >> x[i] >> y[i];
    if (y[i] == 0)
      z++;
    else if (y[i] > 0)
      u++;
    else
      d++;
    y[i] = fabs(y[i]);
  }
  if (u && d) return 0 * printf("-1\n");
  if (z > 1) return 0 * printf("-1\n");
  if (n == 1 && y[1] == 0) return 0 * printf("0\n");
  double l = 0, r = 2e18;
  for (int i = 1; i <= 500; i++) {
    double mid = (l + r) / 2.0;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.10f\n", r);
}
