#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const double PI = 3.14159265358979323846; const double EPS = 1e-12; typedef pair P; typedef long long ll; typedef unsigned long long ull; const ll INF = 1LL<<60; #define N 1000 ll a[N], b[N]; ll n; ll f(ll x){ ll mn = 1e18, mx = 0; for(int i = 0; i < n; i++){ ll r = a[i] + b[i]*x; mn = min(mn, r); mx = max(mx, r); } return mx-mn; } int main(){ cin>>n; for(int i = 0; i < n; i++) cin>>a[i]>>b[i]; ll lb = 1, ub = 1e9+100; // [lb, ub) while(ub-lb>10){ ll lb2 = (lb*2+ub)/3, ub2 = (lb+ub*2)/3; ll lv = f(lb2), rv = f(ub2); if(lv<=rv) ub = ub2; else lb = lb2; } ll res = lb, val = f(res); for(ll i = lb+1; i < ub; i++){ ll v = f(i); if(val>v){ res = i; val = v; } } cout<