//g++ 1.cpp -std=c++17 -O2 -I . #include using namespace std; #include using namespace atcoder; using ll = long long; using ld = long double; using vi = vector; using vvi = vector; using vll = vector; using vvll = vector; using vld = vector; using vvld = vector; using vst = vector; using vvst = vector; #define fi first #define se second #define pb push_back #define eb emplace_back #define pq_big(T) priority_queue,less> #define pq_small(T) priority_queue,greater> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) #define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end()) bool sub(vector> &p,int a){ int n=p.size(); ll min_w=1e18,max_w=-1e18; ll min_v=1e18,max_v=-1e18; for(auto [w,v]:p){ min_w=min(min_w,w); max_w=max(max_w,w); min_v=min(min_v,v); max_v=max(max_v,v); } bool flg=0,flg2=1,flg3=1,flg4,flg5; for(auto [w,v]:p){ flg4=0,flg5=0; if(abs(min_w-w)<=a&&abs(min_v-v)<=a)flg4=1; if(abs(max_w-w)<=a&&abs(max_v-v)<=a)flg4=1; if(abs(min_w-w)<=a&&abs(max_v-v)<=a)flg5=1; if(abs(max_w-w)<=a&&abs(min_v-v)<=a)flg5=1; flg2=min(flg2,flg4); flg3=min(flg3,flg5); } flg=max({flg,flg2,flg3}); return flg; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n;cin>>n; ll min_w=1e18,max_w=-1e18; ll min_v=1e18,max_v=-1e18; vector> p(n); rep(i,0,n){ ll x,y;cin>>x>>y; ll w=x+y,v=x-y; p[i]={w,v}; min_w=min(min_w,w); max_w=max(max_w,w); min_v=min(min_v,v); max_v=max(max_v,v); } ll ng=-1,ok=2e9+1e5; while(ok-ng>1){ ll check=(ok+ng)/2; int flg=0; vector> p1,p2,p3,p4; for(auto [w,v]:p){ if(abs(min_w-w)>check||abs(min_v-v)>check)p1.emplace_back(w,v); if(abs(min_w-w)>check||abs(max_v-v)>check)p2.emplace_back(w,v); if(abs(max_w-w)>check||abs(min_v-v)>check)p3.emplace_back(w,v); if(abs(max_w-w)>check||abs(max_v-v)>check)p4.emplace_back(w,v); } flg=max({flg,(int)sub(p1,check),(int)sub(p2,check),(int)sub(p3,check),(int)sub(p4,check)}); if(flg){ ok=check; } else{ ng=check; } } cout<