#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-10;
const int maxn = 1000 * 1000 * 1000 + 2;
int n;
int a[3][5 * 100 * 1000 + 2];
long double s, e = maxn;
bool check(long double x) {
  long double maxr = -1000000001;
  for (int i = 0; i < n; i++) {
    if (a[2][i] > 0 &&
        (long double)(a[1][i] + (long double)(((long double)x) *
                                              ((long double)a[2][i]))) > maxr)
      maxr = (long double)(a[1][i] + (long double)(((long double)x) *
                                                   ((long double)a[2][i])));
    if (a[2][i] < 0 && maxr != -1000000001 &&
        maxr >= (long double)(a[1][i] + (long double)(((long double)x) *
                                                      ((long double)a[2][i]))))
      return 1;
  }
  return 0;
}
long double bs(long double x, long double y) {
  if (y - x < eps) return x;
  long double min = (long double)((x + y) / (long double)2.0);
  if (check(min))
    return bs(x, min);
  else
    return bs(min, y);
}
int main() {
  cout << fixed << setprecision(12);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[1][i] >> a[2][i];
  if (!check(1000 * 1000 * 1000 + 1.0)) {
    cout << -1 << ".00000000000000000000" << endl;
    return 0;
  }
  cout << bs(s, e) << endl;
  return 0;
}
