#include <bits/stdc++.h>
using namespace std;
const int __ = 1e5 + 5;
const double inf = 5e13;
struct node {
  int x, y;
  void scan() { scanf("%d%d", &x, &y); }
} p[__];
int n;
bool check(double x) {
  double l = -inf, r = inf;
  for (int i = (1); i <= (n); ++i) {
    if (p[i].y > 2 * x) return false;
    double y = sqrt(x * x - (p[i].y - x) * (p[i].y - x));
    l = max(l, p[i].x - y);
    r = min(r, p[i].x + y);
    if (l > r) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    p[i].scan();
    if (1ll * p[i].y * p[1].y < 0) return !printf("-1\n");
  }
  if (p[1].y < 0)
    for (int i = (1); i <= (n); ++i) p[i].y = -p[i].y;
  double l = 0, r = inf;
  for (int i = (1); i <= (100); ++i) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.9f\n", l);
  return 0;
}
