#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x P[1010]; ll val(ll x) { ll ma=0,mi=1LL<<60; int i; if(x<1) return 1LL<<60; FOR(i,N) ma=max(ma,P[i].first*x+P[i].second); FOR(i,N) mi=min(mi,P[i].first*x+P[i].second); return ma-mi; } void solve() { int i,j,k,l,r,x,y; string s; cin>>N; FOR(i,N) { cin>>x>>y; P[i]=make_pair(y,x); } ll ret=1; ll L=1,R=1LL<<30; ll mi=val(L); FOR(i,200) { ll m1=(L*2+R)/3; ll m2=(L+R*2)/3; ll v1=val(m1); ll v2=val(m2); if(v1