#include using namespace std; using ll=long long; const int N=5e5+5,V=1e6+5; int n; struct node{ int x,y; }p[N]; int f[(V<<1)+5]; inline int gt(int l,int r){return f[min(r+V,V*2)]-((l+V-1>=0)?f[l+V-1]:0);} int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>p[i].x>>p[i].y; f[p[i].x+V]++; f[p[i].y+V]--; f[p[i].x-p[i].y+V]--; } for(int i=1;i<=(V*2);i++){ f[i]+=f[i-1]; } int now=-1; int num=0; for(int i=1;i<=V;i++){ int dwn=-(V/i)-(V%i!=0),up=V/i; ll res=0; for(int j=dwn;j<=up;j++){ res+=j*gt(i*j,i*(j+1)-1); } if(res>now){ now=res; num=i; } } cout<