#include <bits/stdc++.h>
using namespace std;
struct Data {
  int x, y;
};
const double eps = 1e-8;
Data d[100010];
int n;
double f(double p) {
  double mx = 0;
  for (int i = 1; i <= n; i++) {
    double a = (d[i].x + p) / 2, b = (double)d[i].y / 2,
           k = (p - d[i].x) / (double)d[i].y;
    mx = max(mx, b + (p - a) * k);
  }
  return mx;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &d[i].x, &d[i].y);
  for (int i = 1; i <= n; i++)
    if ((d[1].y > 0 && d[i].y < 0) || (d[1].y < 0 && d[i].y > 0)) {
      puts("-1");
      return 0;
    }
  for (int i = 1; i <= n; i++)
    if (d[i].y < 0) d[i].y = -d[i].y;
  double l = -3e7, r = 3e7;
  for (; r - l > eps;) {
    double mid1 = (2 * l + r) / 3, mid2 = (l + 2 * r) / 3;
    if (f(mid1) < f(mid2))
      r = mid2;
    else
      l = mid1;
  }
  printf("%.10lf\n", f(l));
  return 0;
}
