#include <bits/stdc++.h>   using namespace std;   pair<long long int, long long int> a[500001];   int main() {     ios::sync_with_stdio(false);     cout << fixed << setprecision(10);     long long int i, j, n, f;     double lo, mid, hi, ans = -1, last;     cin >> n;     for (i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;     lo = 0;     hi = 1e10;     for (i = 0; i < 100; i++) {       mid = (lo + hi) / 2.0;       f = 0;       last = -1e100;       for (j = 1; j <= n; j++) {         if (a[j].second > 0)           last = max(last, 1.0 * (a[j].first + 1.0 * a[j].second * mid));         else {           if (1.0 * (a[j].first + 1.0 * a[j].second * mid) < last) {             f = 1;             break;           }         }       }       if (f) {         hi = mid;         ans = mid;       } else         lo = mid;     }     cout << ans;     return 0;   }   