// https://atcoder.jp/contests/xmascon19/tasks/xmascon19_f #include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>N; vector> S(N); for(int i=0;i>a>>b; S[i]=mp(a+b,a-b); } sort(all(S)); auto solve=[&](vector> X,int type,ll len){ if(si(X)==0) return X; ll miH=INF,maH=-INF,miW=INF,maW=-INF; for(auto [a,b]:X){ chmin(miH,a); chmax(maH,a); chmin(miW,b); chmax(maW,b); } vector> res; ll U,D,L,R; if(type==0){ U=miH; D=miH+len; L=miW; R=miW+len; } if(type==1){ U=miH; D=miH+len; L=maW-len; R=maW; } if(type==2){ U=maH-len; D=maH; L=miW; R=miW+len; } if(type==3){ U=maH-len; D=maH; L=maW-len; R=maW; } for(auto [a,b]:X){ if(U<=a&&a<=D&&L<=b&&b<=R){ }else{ res.push_back(mp(a,b)); } } return res; }; ll left=-1,right=1LL<<33; while(right-left>1){ ll mid=(left+right)/2; bool f=false; for(int a=0;a<4;a++){ auto T1=S; auto T2=solve(T1,a,mid); if(si(T1)==si(T2)) continue; if(si(T2)==0) f=true; for(int b=0;b<4;b++){ auto T3=solve(T2,b,mid); if(si(T2)==si(T3)) continue; if(si(T3)==0) f=true; for(int c=0;c<4;c++){ auto T4=solve(T3,c,mid); if(si(T4)==0) f=true; if(f) break; } if(f) break; } if(f) break; } if(f) right=mid; else left=mid; } cout<