#include <bits/stdc++.h>
using namespace std;
int n;
struct Point {
  int x, y;
};
vector<Point> points;
bool containAll(double r) {
  double top = 1e7, botton = -1e7;
  for (Point& p : points) {
    if (p.x > r * 2) return false;
    double ax = abs(p.x - r);
    double halfy = sqrt(r * r - ax * ax);
    double t = p.y + halfy;
    double b = p.y - halfy;
    top = min(top, t);
    botton = max(botton, b);
    if (top < botton) return false;
  }
  return true;
}
int main() {
  cin >> n;
  points = vector<Point>(n);
  bool flag = false;
  for (int i = 0; i < n; i++) {
    cin >> points[i].y >> points[i].x;
    if (points[i].x < 0) flag = true;
  }
  if (flag) {
    for (int i = 0; i < n; i++) {
      if (points[i].x > 0) {
        cout << -1 << endl;
        return 0;
      }
      points[i].x = -points[i].x;
    }
  }
  double l = 0, r = 3 * 1e14, mid;
  int t = 300;
  while (t--) {
    mid = (l + r) / 2;
    if (containAll(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << setprecision(16) << mid << endl;
  return 0;
}
