#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
template <class T>
long long sgn(T x) {
  return (x > 0) - (x < 0);
}
template <class T>
struct Point {
  T x, y;
  explicit Point(T x = 0, T y = 0) : x(x), y(y) {}
  bool operator<(Point p) const { return tie(x, y) < tie(p.x, p.y); }
  bool operator==(Point p) const { return tie(x, y) == tie(p.x, p.y); }
  Point operator+(Point p) const { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) const { return Point(x - p.x, y - p.y); }
  Point operator*(T d) const { return Point(x * d, y * d); }
  Point operator/(T d) const { return Point(x / d, y / d); }
  T dot(Point p) const { return x * p.x + y * p.y; }
  T cross(Point p) const { return x * p.y - y * p.x; }
  T cross(Point a, Point b) const { return (a - *this).cross(b - *this); }
  T dist2() const { return x * x + y * y; }
  double dist() const { return sqrt((double)dist2()); }
  double angle() const { return atan2(y, x); }
  Point unit() const { return *this / dist(); }
  Point perp() const { return Point(-y, x); }
  Point normal() const { return perp().unit(); }
  Point rotate(double a) const {
    return Point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
  }
  friend ostream& operator<<(ostream& os, Point p) {
    return os << "(" << p.x << "," << p.y << ")";
  }
};
long double EPS = 1e-9;
long long n;
vector<Point<long double> > p;
inline long double good_sqrt(long double D) { return D < 0 ? 0 : sqrt(D); }
inline bool bigger(const long double& x, const long double& y) {
  return x > y + EPS;
}
inline bool small(long double& x, long double y) { return y > x + EPS; }
bool ok(long double R) {
  long double l = -1e16 - 1, r = 1e16 + 1;
  for (long long i = 0; i < n; i++) {
    long double b = -2 * p[i].x;
    long double c = p[i].x * p[i].x + p[i].y * p[i].y - 2 * p[i].y * R;
    long double delta = b * b - 4.0 * c;
    if (delta < -EPS) return false;
    long double D = good_sqrt(delta);
    long double x1 = p[i].x - D / 2;
    long double x2 = p[i].x + D / 2;
    l = max(l, x1);
    r = min(r, x2);
  }
  return !(l > r + EPS);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  long long cima = 0, embaixo = 0;
  p.resize(n);
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    p[i] = Point<long double>(x, y);
    if (y > 0) cima = 1;
    if (y < 0) embaixo = 1;
  }
  if (cima and embaixo) {
    cout << -1 << "\n";
    return 0;
  }
  if (embaixo) {
    for (long long i = 0; i < n; i++) {
      p[i].y = -p[i].y;
    }
  }
  long double l = 0, r = 1e16;
  function<long double(long double, long double)> get_mid;
  if (ok(1)) {
    r = 1;
    get_mid = [](long double l, long double r) { return (l + r) / 2.0; };
  } else {
    l = 1;
    get_mid = [](long double l, long double r) { return sqrt(l * r); };
  }
  for (long long iter = 0; iter < 150; iter++) {
    long double m = get_mid(l, r);
    if (ok(m)) {
      r = m;
    } else
      l = m;
  }
  cout << setprecision(16) << fixed;
  cout << get_mid(l, r) << "\n";
}
