#include <bits/stdc++.h>
using namespace std;
const double INF = 100000000000000.0;
const int N = 100005;
int n, pos, neg, maxx, same, x[N], y[N], i;
double a, b, ind;
double getEps(double c) {
  if (c > 10000000000) return 0.1;
  return 1e-6;
}
bool can(double r) {
  double c, d;
  double minn = -INF;
  double maxx = INF;
  for (i = 0; i < n; i++) {
    c = y[i] - r;
    d = sqrt(r - c) * sqrt(r + c);
    minn = max(minn, x[i] - d);
    maxx = min(maxx, x[i] + d);
    if (minn > maxx) return false;
  }
  return true;
}
int main() {
  scanf("%d", &n);
  pos = neg = 0;
  maxx = 0;
  same = 1;
  for (i = 0; i < n; i++) {
    scanf("%d %d", &x[i], &y[i]);
    if (y[i] > 0)
      pos = 1;
    else {
      neg = 1;
      y[i] *= (-1);
    }
    maxx = max(maxx, y[i]);
    if (i > 0 && x[i] != x[i - 1]) same = 0;
  }
  if (pos && neg) {
    printf("-1\n");
    return 0;
  }
  if (same) {
    printf("%.9lf\n", maxx / 2.0);
    return 0;
  }
  a = maxx / 2.0;
  b = INF;
  while (true) {
    ind = (b + a) / 2;
    if (b - a < getEps(ind)) break;
    if (can(ind))
      b = ind;
    else
      a = ind;
  }
  printf("%.9lf\n", ind);
  return 0;
}
