#include #include #include using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,n,0) #define REP(i,s,e) for (i = s; i < e; i++) #define rep(i,n) REP(i,0,n) #define INF 1e8 typedef long long ll; int n; ll a[1000], b[1000], c[1000]; ll f(ll x) { int i; rep (i,n) c[i] = a[i] + b[i] * x; return *max_element(c,c+n) - *min_element(c,c+n); } int main() { int i; ll r, l; cin >> n; rep (i,n) cin >> a[i] >> b[i]; l = 1; r = 1e9; while (l < r) { ll m1 = (l*2+r) / 3; ll m2 = (l+r*2+1) / 3; if (f(m1) <= f(m2)) r = m2; else l = m1+1; } cout << r << endl; return 0; }