peterverebics/CodeNet_Python_118 huggingface dataset:
n=int(input())
x=[0]*n
y=[0]*n
z=[]
w=[]
for i in range(n):
    x[i],y[i]= list(map(int, input().strip().split()))
    z.append(x[i]+y[i])
    w.append(x[i]-y[i])
a=max(z)-min(z)
b=max(w)-min(w)
print(max(a,b))
n = int(input())
p_mn = m_mn= 10**9 * 2
p_mx = m_mx = -p_mn
for i in range(n):
    x, y = map(int, input().split())
    p = x + y
    m = x - y
    p_mx = max(p_mx, p)
    p_mn = min(p_mn, p)
    m_mx = max(m_mx, m)
    m_mn = min(m_mn, m)
print(max(p_mx-p_mn, m_mx-m_mn))
n = int(input())
c = [[int(i) for i in input().split()] for i in range(n)]
z = []
w = []
for i in range(n):
    z.append(c[i][0] + c[i][1])
    w.append(c[i][1] - c[i][0])
ans = max(max(z)-min(z), max(w)-min(w))
print(ans)
n=int(input())
rmax=-10**10
rmin=10**10
lmax=-10**10
lmin=10**10
for i in range(n):
    xi,yi=map(int,input().split())
    rmax=max(rmax,xi+yi)
    rmin=min(rmin,xi+yi)
    lmax=max(lmax,xi-yi)
    lmin=min(lmin,xi-yi)
    
print(max(rmax-rmin,lmax-lmin))
n=int(input())
p=[]
m=[]
bb=0
tt=False
for i in range(n):
    x,y=list(map(int,input().split()))
    p.append(x+y)
    m.append(x-y)
    bb+=1

minp=min(p)
maxp=max(p)
minm=min(m)
maxm=max(m)

ans=[maxp-minp,maxm-minm,minm,maxm,minp-maxp]
print(max(ans))
N=int(input())
xy = [tuple(map(int,input().split())) for _ in range(N)]
ans = 0

def dist(tpl1, tpl2):
    return abs(tpl1[0] - tpl2[0]) + abs(tpl1[1] - tpl2[1])

f0 = []
f1 = []
for i in range(N):
    x, y = xy[i]
    f0.append(x-y)
    f1.append(x+y)
ans = max(ans,
        max(f0) - min(f0),
        max(f1) - min(f1))
print(ans)
def main():
    n = int(input())
    s = [0] * n
    d = [0] * n
    for i in range(n):
        x, y = map(int, input().split())
        s[i] = x + y
        d[i] = x - y
    print(max(max(s) - min(s), max(d) - min(d)))


if __name__ == '__main__':
    main()
def solve(n, x, y):
    z = [u + v for u, v in zip(x, y)]
    w = [u - v for u, v in zip(x, y)]
    return max([max(z) - min(z), max(w) - min(w)])

n = int(input())
x, y = zip(*[map(int, input().split()) for i in range(n)])
print(solve(n, x, y))
N = int(input())
xpy = [0]*N
xmy = [0]*N
for i in range(N):
  x,y = map(int, input().split())
  xpy[i] = x+y
  xmy[i] = x-y
xpy.sort()
xmy.sort()
print(max(xpy[-1]-xpy[0],xmy[-1]-xmy[0]))
n = int(input())
plus = []
minus = []

for i in range(n):
    x, y = map(int, input().split())
    plus.append(x + y)
    minus.append(x - y)

result = max(max(plus) - min(plus), max(minus) - min(minus))
print(result)
n = int(input().strip())
l = []
 
for i in range(n):
    x, y = map(int, input().split())
    a = y + x
    b = y - x
    l.append([x, y, a, b])
 
la = sorted(l, key=lambda z: z[2])
lb = sorted(l, key=lambda z: z[3])
 
print(max(abs(la[0][0] - la[-1][0]) + abs(la[0][1]-la[-1][1]),
          abs(lb[0][0] - lb[-1][0]) + abs(lb[0][1]-lb[-1][1])
          )
      )
n = int(input())
p = []
m = []
for i in range(n):
    x,y = map(int,input().split())
    p.append(x+y)
    m.append(x-y)
p.sort()
m.sort()
print(max(p[-1]-p[0],m[-1]-m[0]))
N = int(input())
X = [0] * N
Y = [0] * N
for i in range(N):
    X[i], Y[i] = map(int,input().split())

MAX = float('-inf')
MIN = float('inf')

for i in range(N):
    MAX = max(MAX, X[i] - Y[i])
    MIN = min(MIN, X[i] - Y[i])

ans = MAX - MIN

MAX = float('-inf')
MIN = float('inf')

for i in range(N):
    MAX = max(MAX, X[i] + Y[i])
    MIN = min(MIN, X[i] + Y[i])

ans = max(ans, MAX - MIN)

print(ans)
n = int(input())
s = []
m = []
for i in range(n):
  a, b = map(int, input().split())
  s.append(a+b)
  m.append(a-b)
print(max(max(s)-min(s), max(m)-min(m)))
N = int(input())
z = [0] * N
w = [0] * N
for i in range(N):
  x, y = map(int, input().split())
  z[i] = x + y
  w[i] = x - y
  
z = sorted(z)
w = sorted(w)
#print(z)
#print(w)
ans = max(abs(z[-1] - z[0]), abs(w[-1] - w[0]))
print(ans)
N = int(input())
xs = []
ys = []
for _ in range(N):
    x,y = map(int,input().split())
    xs.append(x)
    ys.append(y)
fxys = [[], []]
for i in range(N):
    x = xs[i]
    y = ys[i]
    fxys[0].append(x-y)
    fxys[1].append(x+y)
ls = []
for d in [0, 1]:
    mx = max(fxys[d])
    mi = min(fxys[d])
    ls.append(mx-mi)
print(max(ls))
import sys
input = sys.stdin.readline

N = int(input())
SUM,DIF = [],[]
for _ in range(N):
  x,y = map(int, input().split())
  SUM.append(x+y)
  DIF.append(x-y)
  
SUM.sort()
DIF.sort()

print(max(abs(SUM[0] - SUM[-1]), abs(DIF[0] - DIF[-1])))
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    plus = []
    minus = []
    for _ in range(n):
        x, y = map(int, input().split())
        plus.append(x + y)
        minus.append(x - y)
    plus.sort()
    minus.sort()
    ans = max(plus[-1] - plus[0], minus[-1] - minus[0])
    print(ans)

main()
n=int(input())
arr1=[0]*n
arr2=[0]*n
for i in range(n):
    x,y=map(int, input().split())
    arr1[i]=x+y
    arr2[i]=x-y

arr1=sorted(arr1)
p=arr1[-1]-arr1[0]
arr2=sorted(arr2)
q=arr2[-1]-arr2[0]
print(max(p,q))
n,*z=map(int,open(0).read().split())
a,b=[],[]
for x,y in zip(*[iter(z)]*2):
    a+=x+y,
    b+=x-y,
print(max(abs(max(a)-min(a)),abs(max(b)-min(b))))
N = int(input())
P = [tuple(map(int, input().split())) for i in range(N)]

X = [x + y for x, y in P]
Y = [x - y for x, y in P]
print(max(max(X) - min(X), max(Y) - min(Y)))
import sys
input=sys.stdin.readline
N=int(input())
m=[]
a=[-float("inf"), float("inf")]
b=[-float("inf"), float("inf")]
for _ in range(N):
    x, y = map(int, input().split())
    a[0] = max(a[0], x+y)
    a[1] = min(a[1], x+y)
    b[0] = max(b[0], x-y)
    b[1] = min(b[1], x-y)
print(max(abs(a[0]-a[1]), abs(b[0]-b[1])))
N = int(input())

def dist(A, B):
    return abs(A[0] - B[0]) + abs(A[1] - B[1])

XY = [tuple(map(int, input().split())) for _ in range(N)]
INF = -10**10

ans = 0
for O in [(INF, INF), (-INF, INF)]:
    S = XY[0]
    for xy in XY:
        if dist(O, S) < dist(O, xy):
            S = xy
    O = S
    for xy in XY:
        if dist(O, S) < dist(O, xy):
            S = xy
    ans = max(ans, dist(O, S))
print(ans)
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

n=int(input())
xs=[]
ys=[]
for _ in range(n):
    x,y=map(int,input().split())
    tx,ty=x+y,x-y
    xs.append(tx)
    ys.append(ty)
xs=sorted(xs)
ys=sorted(ys)
ans=max(abs(xs[-1]-xs[0]),abs(ys[-1]-ys[0]))
print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N = int(readline())
    m = map(int,read().split())
    XY = list(zip(m,m))

    ans = 0
    z = [x-y for (x, y) in XY]
    # print(z)
    z.sort()
    ans = z[-1] - z[0]
    z = [x+y for (x, y) in XY]
    # print(z)
    z.sort()
    ans = max(ans, z[-1] - z[0])

    print(ans)

if __name__ == '__main__':
    main()
n=int(input())
s=[]
t=[]
for i in range(n):
  x,y=map(int,input().split())
  s.append(x+y)
  t.append(x-y)
  
print(max(max(s)-min(s),max(t)-min(t)))
n = int(input())
x = [0]*n
for i in range(n):
    x[i] = list(map(int,input().split()))

d0 = [0]*n
d1 = [0]*n
for i,[x,y] in enumerate(x) :
    d0[i] = x-y
    d1[i] = x+y
print(max(max(d0)-min(d0), max(d1)-min(d1)))
N=int(input())
point=list()
for i in range(N):
    point.append([int(i) for i in input().split()])
#print(point)

list_a=sorted(point,key=lambda x:x[0]+x[1])
list_b=sorted(point,key=lambda x:x[1]-x[0])

ps=[list_a[0],list_a[N-1],list_b[0],list_b[N-1]]
#print(ps)
ans=0

for p1 in ps:
    for p2 in ps:
        ans=max(ans,abs(p1[0]-p2[0])+abs(p1[1]-p2[1]))

print (ans)
N=int(input())
A=[]
B=[]
for _ in range(N):
    x,y=map(int, input().split())
    A.append(x+y)
    B.append(x-y)

A=sorted(A)
B=sorted(B)

print(max(A[-1]-A[0],B[-1]-A[0],A[-1]-A[0],B[-1]-B[0]))
n = int(input())
xy_array = [list(map(int, input().split())) for _ in range(n)]

th = pow(10, 9)
z_max = -th
z_min = th
w_max = -th
w_min = th

for x, y in xy_array:
    z_max = max(x + y, z_max)
    z_min = min(x + y, z_min)
    w_max = max(x - y, w_max)
    w_min = min(x - y, w_min)

ans = max(z_max - z_min, w_max - w_min)
print(ans)
N = int(input())
coords, minus, plus = [], [], []
for _ in range(N):
    x, y = map(int,input().split())
    coords.append([x,y])
    minus.append(x-y)
    plus.append(x+y)

minus.sort()
plus.sort()

ans = 0
for x, y in coords:
    now_minus, now_plus = x-y, x+y
    ans = max(ans, abs(now_minus-minus[0]), abs(now_minus-minus[-1]))
    ans = max(ans, abs(now_plus-plus[0]), abs(now_plus-plus[-1]))

print(ans)
n = int(input())
xy=[list(map(int,input().split())) for i in range(n)]

d1 = []
d2 = []
for x,y in xy:
    d1.append(x-y)
    d2.append(x+y)

ans1=max(d1)-min(d1)
ans2=max(d2)-min(d2)

print(max(ans1,ans2))
n=int(input())

ans=[]
ans1=[]

for _ in range(n):
  a,b=map(int,input().split())
  d=a-b
  c=a+b
  ans.append(c)
  ans1.append(d)
  
m=min(ans)
M=max(ans)

P=M-m
Q=max(ans1)-min(ans1)

print(max(P,Q))
n= int(input())
a = [list(map(int, input().split())) for i in range(n)]
b = []
c = []
for i in range(n):
  b.append(a[i][0]+a[i][1])
  c.append(a[i][0]-a[i][1])
maxbc=[max(b)-min(b), max(c)-min(c)]
print(max(maxbc))
n = int(input())
l = [[] for i in range(4)]
for i in range(n):
    x, y = map(int, input().split())
    l[0].append(x+y)
    l[1].append(x-y)
    l[2].append(-x+y)
    l[3].append(-x-y)
for i in range(4):
    l[i].sort()
ans = 0
for i in range(4):
    ans = max(ans, l[i][-1] - l[i][0])
print(ans)
from sys import stdin
n=int(input())
D1=[]
D2=[]
for _ in range(n):
    x, y= map(int, stdin.readline().split())
    r1=x+y
    r2=abs((10**9-x)+y)
    D1.append(r1)
    D2.append(r2)

ans1=max(D1)-min(D1)
ans2=max(D2)-min(D2)
print(max(ans1,ans2))
N = int(input())

minus = []
plus = []

for _ in range(N):
  x, y = map(int, input().split())
  minus.append(x-y)
  plus.append(x+y)

print(max(max(minus) - min(minus),
          max(plus)  - min(plus)))
N=int(input())
A=[0]*(N)
B=[0]*(N)
for i in range(N):
    x,y=map(int, input().split())
    A[i]=x+y
    B[i]=x-y

A=sorted(A)
B=sorted(B)

print(max(A[-1]-A[0],B[-1]-A[0],A[-1]-A[0],B[-1]-B[0]))
N = int(input())
xy = []
xplusy = []
xminusy = []

for i in range(N):
    x, y = map(int, input().split())
    xplusy.append(x+y)
    xminusy.append(x-y)


ans1 = max(xplusy) - min(xplusy)
ans2 = max(xminusy) - min(xminusy)

print(max(ans1, ans2))
n = int(input())
xy = list(list(map(int, input().split())) for _ in range(n))

#print(n, xy)
x_minus_y = []
x_plus_y = []
for i in range(n):
    x_minus_y.append(xy[i][0] - xy[i][1])
    x_plus_y.append(xy[i][0] + xy[i][1])
x_max = max(x_minus_y)
x_min = min(x_minus_y)
y_max = max(x_plus_y)
y_min = min(x_plus_y)

if x_max - x_min >= y_max - y_min:
    print(x_max - x_min)
else:
    print(y_max - y_min)
from collections import deque
N=int(input())

L1=[0 for _ in range(N)]
L2=[0 for _ in range(N)]
for i in range(N):
    x,y=map(int,input().split())
    L1[i],L2[i]=x-y,x+y


mi1=min(L1)
ma1=max(L1)
mi2=min(L2)
ma2=max(L2)

ans=max(ma1-mi1,ma2-mi2)
print(ans)
n = int(input())
mi1= 10**10
ma1= -10**10
mi2=10**10
ma2=-10**10
P = []
for i in range(n):
  a = list(map(int,input().split()))
  P.append(a)
P.sort(key = lambda x:x[0])
for i in range(n):
    p=P[i]
    mi1=min(mi1,p[0]+p[1])
    ma1=max(ma1,p[0]+p[1])
    mi2=min(mi2,p[0]-p[1])
    ma2=max(ma2,p[0]-p[1])
print(max(ma1-mi1,ma2-mi2))
N=int(input())
Z=[0]*N
W=[0]*N

for i in range(N):
  x, y = map(int, input().split())
  Z[i]=x+y
  W[i]=x-y

print(max(max(Z)-min(Z),max(W)-min(W)))
n = int(input())
Xs = []
Ys = []
for _ in range(n):
    x, y = map(int, input().split())
    Xs.append(x+y)
    Ys.append(x-y)
Xs.sort()
Ys.sort()

print(max(Xs[-1]-Xs[0], Ys[-1]-Ys[0]))
n = int(input())
xx = []
yy = []
for _ in range(n):
    x, y = map(int, input().split())
    xx.append(x + y)
    yy.append(x - y)

print(max(max(xx) - min(xx), max(yy) - min(yy)))
n = int(input())

a, b = map(int, input().split())
mini = a+b
maxi = a+b

mini1 = a-b
maxi1 = a-b

for i in range(n-1):
    a, b = map(int, input().split())
    
    mini = min(a+b, mini)
    maxi = max(a+b, maxi)
    mini1 = min(a-b, mini1)
    maxi1 = max(a-b, maxi1)
    
ans = max(maxi-mini, maxi1-mini1)
print(ans)
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
z = [x + y for x, y in xy]
w = [x - y for x, y in xy]
print(max(max(z) - min(z), max(w) - min(w)))
N=int(input())
L=[list(map(int,input().split())) for i in range(N)]
zmax=zmin=L[0][0]+L[0][1]
wmax=wmin=L[0][0]-L[0][1]
for a,b in L:
    z,w=a+b,a-b
    zmax=max(zmax,z)
    zmin=min(zmin,z)
    wmax=max(wmax,w)
    wmin=min(wmin,w)
print(max(zmax-zmin,wmax-wmin))
n=int(input())
ad=[0]*n
su=[0]*n
for i in range(n):
  x,y=map(int,input().split())
  ad[i]=x+y
  su[i]=x-y
ad.sort()
su.sort()
print(max(ad[-1]-ad[0],su[-1]-su[0]))
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
for i in range(N):
  X[i]=[X[i][0]+X[i][1],X[i][0]-X[i][1]]
print(max([max([X[i][j] for i in range(N)])-min([X[i][j] for i in range(N)]) for j in range(2)]))
N = int(input())
a,b = [], []
for i in range(N):
  x,y = map(int, input().split())
  a.append(x-y)
  b.append(x+y)
a.sort()
b.sort()
ans = max(a[-1] - a[0], b[-1] - b[0])
print(ans)
N = int(input())
A=[]; B= []
for i in range(N):
  a,b = map(int,input().split())
  A.append((a+b))
  B.append((a-b))
A.sort()
B.sort()
ans = max(A[-1]-A[0],B[-1]-B[0])
print(ans)
z = []
w = []

for _ in range(int(input())):
    x, y = map(int, input().split())
    z.append(x + y)
    w.append(x - y)


z_max = max(z)
z_min = min(z)
w_max = max(w)
w_min = min(w)

print(max([abs(z_max - z_min), abs(w_max - w_min)]))
import numpy as np
N = int(input())

x = []
y = []
xy1 = []
xy2 = []

for i in range(N):
    a, b = (int(t) for t in input().split())
    x.append(a)
    y.append(b)
    xy1.append(a + b)
    xy2.append(a - b)

max1 = max(xy1) - min(xy1)
max2 = max(xy2) - min(xy2)
print(max((max1, max2)))
import sys
input = sys.stdin.readline

N = int(input())
points = [0] * N
rx = []
ry = []
for i in range(N):
    x, y = map(int, input().split())
    rx.append(x - y)
    ry.append(x + y)
print(max(max(rx) - min(rx), max(ry) - min(ry)))
import sys
input = sys.stdin.readline
n = int(input())
max_pp = -2 * 10**10
min_pp = 2 * 10**10
max_pn = -2 * 10**10
min_pn = 2 * 10**10

for i in range(n):
  x, y = map(int, input().split())
  max_pp = max(max_pp, x + y)
  min_pp = min(min_pp, x + y)
  max_pn = max(max_pn, x - y)
  min_pn = min(min_pn, x - y)
print(max(max_pp - min_pp, max_pn - min_pn))
N=int(input())
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]

xyp=[]
xym=[]
for i in range(N):
    xyp.append(x[i]+y[i])
    xym.append(x[i]-y[i])
    
print(max(max(xyp)-min(xyp),-min(xym)+max(xym),max(xym)-min(xym),-min(xym)+max(xym)))
n = int(input())
d1 = []
d2 = []
for i in range(n):
  x,y = map(int,input().split())
  d1.append(x-y)
  d2.append(x+y)
one = max(d1)-min(d1)
two = max(d2)-min(d2)
print(max(one,two))
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())
z = [0] * n
w = [0] * n
for i in range(n):
    z[i] = x[i] + y[i]
    w[i] = x[i] - y[i]
cand1 = max(z) - min(z)
cand2 = max(w) - min(w)
print(max(cand1, cand2))
sumi=[]
diff=[]
t=int(input())
for _ in range(t):
  z=list(map(int,input().split()))
  sumi.append(z[0]+z[1])
  diff.append(z[0]-z[1])
print (max(max(diff)-min(diff),max(sumi)-min(sumi)))
n = int(input())
max_XminusY = -float('inf')
min_XminusY =  float('inf')
max_XplusY  = -float('inf')
min_XplusY  =  float('inf')

for _ in range(n):
    x, y = map(int, input().split())
    max_XminusY = max(max_XminusY, x - y)
    min_XminusY = min(min_XminusY, x - y)
    max_XplusY  = max(max_XplusY, x + y)
    min_XplusY  = min(min_XplusY, x + y)

print(max(abs(max_XminusY - min_XminusY), abs(max_XplusY - min_XplusY)))
N = int(input())

# マンハッタン距離
plus = []
minus = []
for _ in range(N):
    x, y = map(int, input().split())
    plus.append(x + y)
    minus.append(x - y)

print(max(max(plus) - min(plus), max(minus) - min(minus)))
import sys
input = sys.stdin.readline
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]

xy.sort()

xy2 = [(x-y,x+y) for x,y in xy]

xd, yd = zip(*xy2)

dx = max(xd) - min(xd)
dy = max(yd) - min(yd)
print(max(dx,dy))
N = int(input())
x, y = map(int, input().split())
A = [x + y, x + y, y - x, y - x]
for i in range(N - 1):
  x, y = map(int, input().split())
  p = x + y
  q = y - x
  A[0] = max(A[0], p)
  A[1] = min(A[1], p)
  A[2] = max(A[2], q)
  A[3] = min(A[3], q)
print(max(A[0] - A[1], A[2] - A[3]))
n=int(input())
a=[]
b=[]
for i in range(n):
    x,y= map(int,input().split())
    a.append(y-x)
    b.append(x+y)
a.sort()
b.sort()
print(max(a[-1]-a[0], b[-1]-b[0]))
n = int(input())
maxx, minx, maxy, miny = -10 ** 10, 10 ** 10, -10 ** 10, 10 ** 10
for i in range(n):
    x, y = map(int, input().split())
    x, y = x + y, x - y
    maxx = max(x, maxx)
    minx = min(x, minx)
    maxy = max(y, maxy)
    miny = min(y, miny)
print(max(maxx - minx, maxy - miny))
from collections import deque
N = int(input())

AM, Am, BM, Bm = -1*10**9*2, 10**9*2, -1*10**9*2, 10**9*2
for _ in range(N):
    x, y = map(int, input().split())
    AM = max(AM, x+y)
    Am = min(Am, x+y)
    BM = max(BM, x-y)
    Bm = min(Bm, x-y)


print(max(AM-Am, BM-Bm))
n=int(input())
a=[]
b=[]
for i in range(n):
  x,y=map(int,input().split())
  a.append(x+y)
  b.append(x-y)
print(max(max(a)-min(a),max(b)-min(b)))
N = int(input())
za = []
for _ in range(N):
    x, y = map(int,input().split())
    za.append((x + y, y - x))
X = max(za, key = lambda x:x[0])[0] - min(za, key = lambda x:x[0])[0]
Y = max(za, key = lambda x:x[1])[1] - min(za, key = lambda x:x[1])[1]
print(max(X, Y))
import sys,math,collections,itertools
input = sys.stdin.readline

N=int(input())
zmax=-float('inf')
zmin = float('inf')
wmax = -float('inf')
wmin = float('inf')

for _ in range(N):
    x,y=map(int,input().split())
    z=x+y
    w=x-y
    zmax = max(z,zmax)
    zmin = min(z,zmin)
    wmax = max(w,wmax)
    wmin = min(w,wmin)
print(max(zmax-zmin,wmax-wmin))
N=int(input())
x=[]
y=[]
for i in range(N):
    b,c=map(int,input().split(" "))
    x.append(b+c)
    y.append(b-c)
print(max([max(x)-min(x),max(y)-min(y)]))
'''
Created on 2020/09/14

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  x,y=map(int,pin().split())
  z1=x+y
  z2=x+y
  w1=x-y
  w2=x-y
  for i in range(N-1):
    x,y=map(int,pin().split())
    z1=max(z1,x+y)
    z2=min(z2,x+y)
    w1=max(w1,x-y)
    w2=min(w2,x-y)
  print(max(z1-z2,w1-w2))
  return
main()
#解説AC
n=int(input())
r=[list(map(int,input().split())) for _ in range(n)]
a,c,b,d=0,10**10,0,10**10
for i in range(n):
    y,x=r[i]
    a=max(a,x+y)
    c=min(c,x+y)
    b=max(b,x-y)
    d=min(d,x-y)
print(max(abs(a-c),abs(b-d)))
N = int(input())
xs, ys = [], []
for _ in range(N):
    x, y = map(int, input().split())
    xs.append(x)
    ys.append(y)
U = [x + y for x, y in zip(xs, ys)]
V = [x - y for x, y in zip(xs, ys)]
ans = max([max(U) - min(U), max(V) - min(V)])
print(ans)
n=int(input())
M=[]
N=[]
for i in range(n):
    x,y=map(int,input().split())
    M.append(x+y)
    N.append(x-y)


p=max(M)-min(M)
q=max(N)-min(N)
print(max(p,q))
N = int(input())
xys = [list(map(int, input().split())) for _ in range(N)]

xys = sorted(xys, key= lambda x: x[0])

answer = 0
a = []
b = []
for xy in xys:
    a.append(xy[0] + xy[1])
    b.append(xy[0] - xy[1])
    
print(max(max(a)-min(a), max(b)-min(b)))
N = int(input())

Xmax = -2*10**9
Ymax = -2*10**9
Xmin = 2*10**9
Ymin = 2*10**9


for i in range(N):
    x, y = map(int, input().split())
    if (x + y >= Xmax):
        Xmax = x + y
    if (x + y <= Xmin):
        Xmin = x + y
    if (x - y >= Ymax):
        Ymax = x - y
    if (x - y <= Ymin):
        Ymin = x - y

print(max(Xmax - Xmin, Ymax - Ymin))
n=int(input())
z=[]
c=[]
for j in range(n):
    x1,y1=[int(j) for j in input().split()]
    z.append(x1+y1)
    c.append(x1-y1)
za=max(z)
zi=min(z)
ca=max(c)
ci=min(c)
mx=max(za-zi,ca-ci)
print(mx)
n=int(input())
l1=[]
l2=[]
for _ in range(n):
    x,y=map(int,input().split())
    l1.append(x+y)
    l2.append(x-y)
print(max(max(l1)-min(l1),max(l2)-min(l2)))
def resolve():
    N = int(input())
    Z = []
    W = []

    for i in range(N):
        x, y = map(int, input().split())
        Z.append(x + y)
        W.append(x - y)

    a = max(Z) - min(Z)
    b = max(W) - min(W)
    print(max(a, b))


if __name__ == "__main__":
    resolve()
n=int(input())
l=[]
lans=[]
for i in range(n):
  x,y=(map(int,input().split()))
  l.append(x+y)
  lans.append(x-y)

l.sort()
lans.sort()
#print(l)
print(max(l[-1]-l[0],lans[-1]-lans[0]))

'''
  ll1=[ll[1],ll[0]]
  lan.append(ll1)

l.sort()
lan.sort()
we=abs(l[0][0]-l[-1][0])+abs(l[0][1]-l[-1][1])
we1=abs(lan[0][0]-lan[-1][0])+abs(lan[0][1]-lan[-1][1])
print(max(we,we1))
'''
N = int(input())
L1, L2 = [], []
for i in range(N):
  l = list(map(int, input().split()))
  L1.append(l[0]-l[1])
  L2.append(l[0]+l[1])
  
ans = max(max(L1)-min(L1), max(L2)-min(L2))
print(ans)
n=int(input())
s,p=10**100,10**100
t,q=-1000000000000,-1000000000000

for i in range(n):
  x,y=map(int,input().split())
  s=min(s,x+y)
  t=max(t,x+y)
  p=min(p,x-y)
  q=max(q,x-y)
  
print(max(t-s,q-p))
n = int(input())

max_s = 1 - (10 ** 9)
min_s = 2 * (10 ** 9)
max_t = 1 - (10 ** 9)
min_t = 2 * (10 ** 9)
for _ in range(n):
    x, y = map(int, input().split())
    s = x - y
    t = x + y
    
    max_s = max(max_s, s)
    min_s = min(min_s, s)
    max_t = max(max_t, t)
    min_t = min(min_t, t)

print(max(max_s - min_s, max_t - min_t))
n = int(input())
disadd = []
disminus = []
for i in range(n):
    x, y = map(int, input().split())
    disadd.append(x+y)
    disminus.append(x-y)

print(max(max(disadd)-min(disadd), max(disminus) - min(disminus)))
N=int(input())
x=[0]*N
for i in range(N):
    x[i]=list(map(int,input().split()))
#print(x)
z=[0]*N
w=[0]*N

for i in range(N):
    z[i]=x[i][0]+x[i][1]
    w[i]=x[i][0]-x[i][1]

print(max(max(z)-min(z),max(w)-min(w)))
N = int(input())
ma = 2*(10**9)+1
Ma = 0
mb = 10**9
Mb = 2-10**9
for i in range(N):
  a,b = map(int,input().split())
  tempa = a+b
  ma = min(ma,tempa)
  Ma = max(Ma,tempa)
  tempb = b-a
  mb = min(mb,tempb)
  Mb = max(Mb,tempb)
print(max(Ma-ma,Mb-mb))
n = int(input())

z = list()
w = list()

for i in range(n):
    x,y = list(map(int,input().split()))
    z.append(x + y)
    w.append(x - y)

ans = max(max(z) - min(z),max(w)-min(w))

print(ans)
N = int(input())
z = []
w = []
for i in range(N):
    x,y = map(int,input().split())
    z.append(x+y)
    w.append(x-y)

z_max = max(z)
z_min = min(z)
w_max = max(w)
w_min = min(w)

print(max(z_max-z_min,w_max-w_min))
n = int(input())
ten = [list(map(int, input().split())) for i in range(n)]

for i in ten:
    x = i[0]
    y = i[1]
    i[0] = x-y
    i[1] = x+y

xmax = i[0]
xmin = i[0]
ymax = i[1]
ymin = i[1]
for i in ten:
    xmax = max(xmax,i[0])
    xmin = min(xmin,i[0])
    ymax = max(ymax,i[1])
    ymin = min(ymin,i[1])

print(max(xmax-xmin,ymax-ymin))
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
x = []
y = []
for i in range(n):
    xx,yy = inm()
    x.append(xx)
    y.append(yy)
dif = [x[i]-y[i] for i in range(n)]
sum = [x[i]+y[i] for i in range(n)]
print(max(max(dif)-min(dif),max(sum)-min(sum)))
def get_ints():
    return list(map(int, input().split()))

n = int(input())
a, b = [], []
for i in range(n):
    x, y = get_ints()
    a.append(x+y)
    b.append(x-y)

a.sort()
b.sort()
print(max(a[-1] - a[0], b[-1] - b[0]))
max2 = lambda x,y: x if x > y else y
min2 = lambda x,y: x if x < y else y

N = int(input())

ru = -2*10**9
lu = -2*10**9
ld = -2*10**9
rd = -2*10**9

for _ in range(N):
    x,y = map(int,input().split())
    a = x+y
    b = x-y
    ru = max2(ru,a)
    lu = max2(lu,-b)
    ld = max2(ld,-a)
    rd = max2(rd,b)

print(max2(ru+ld,lu+rd))
n = int(input())
max_x = max_y = - 5 * 10**9
min_x = min_y = 5 * 10**9
for i in range(n):
    X, Y = map(int, input().split())
    x = X + Y
    y = X - Y
    max_x = max(max_x, x)
    max_y = max(max_y, y)
    min_x = min(min_x, x)
    min_y = min(min_y, y)
print(max(max_x - min_x, max_y - min_y))