peterverebics/CodeNet_Python_118 huggingface dataset:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())
xy = [[] for _ in range(n)]
f1 = []
f2 = []
for i in range(n):
    x, y = map(int, input().split())
    f1.append(x + y)
    f2.append(x - y)
    xy[i].append(x + y)
    xy[i].append(abs(-x - y))

print(max(max(f1) - min(f1), max(f2) - min(f2)))
n = int(input())

x_plus_y = []
x_minus_y = []

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

x_plus_y_max = max(x_plus_y)
x_plus_y_min = min(x_plus_y)
x_minus_y_max = max(x_minus_y)
x_minus_y_min = min(x_minus_y)

print(max(x_plus_y_max - x_plus_y_min,
          x_minus_y_max - x_minus_y_min))
n=int(input())
a,b=[],[]
for _ in range(n):
  x,y=map(int,input().split())
  a+=(x+y),;b+=(x-y),
c=max(a)-min(a)
d=max(b)-min(b)
ans=max(c,d)
print(ans)
n = int(input())
d1 = []
d2 = []
for _ in range(n):
    a,b = map(int,input().split())
    d1.append(a+b)
    d2.append(a-b)
print(max(max(d1)-min(d1),max(d2)-min(d2)))
N=int(input())
A=list()
B=list()
for i in range(N):
  x,y=map(int,input().split())
  A.append(x+y)
  B.append(x-y)
s=max(A)-min(A)
t=max(B)-min(B)
print(max(s,t))
n = int(input())
x = []
y = []
for i in range(n):
    l = list(map(int, input().split()))
    x.append(l[0]+l[1])
    y.append(l[0]-l[1])
print(max(max(x)-min(x), max(y)-min(y)))
INF=10**10
n=int(input())
f=lambda:map(int,input().split())
s_min=t_min=INF
s_max=t_max=-INF
for _ in range(n):
  x,y=f()
  s_min=min(s_min,x+y)
  s_max=max(s_max,x+y)
  t_min=min(t_min,x-y)
  t_max=max(t_max,x-y)
print(max(s_max-s_min,t_max-t_min))
# coding: utf-8
# Your code here!
N=int(input())

Z=[]
W=[]

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

p = [0] * N
m = [0] * N
for i in range(N):
    x, y = map(int, input().split())
    p[i] = x + y
    m[i] = x - y

pm = max(p) - min(p)
mm = max(m) - min(m)

print(max(pm, mm))
def main():
    N = int(input())
    x, y = map(int, input().split())
    a1 = x + y
    a2 = x + y
    b1 = y - x
    b2 = y - x
    N -= 1
    while N != 0:
        x, y = map(int, input().split())
        a1 = max(a1, x + y)
        a2 = min(a2, x + y)
        b1 = max(b1, y - x)
        b2 = min(b2, y - x)
        N = N - 1
    print(max(a1 - a2, b1 - b2))

main()
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_max = max(plus)
    plus_min = min(plus)
    minus_max = max(minus)
    minus_min = min(minus)

    print(max(plus_max - plus_min, minus_max - minus_min))


if __name__ == "__main__":
    main()
n = int(input())
xy = [list(map(int,input().split()))for _ in range(n)]

iti = -float("inf")
ni = -float("inf")
san = -float("inf")
yon = -float("inf")
for x,y in xy:
    iti = max(iti,x+y)
    ni = max(ni,x-y)
    san = max(san,-x+y)
    yon = max(yon,-x-y)

print(max(iti+yon,ni+san))
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

f0 = [x - y for x, y in xy]
f1 = [x + y for x, y in xy]

f0.sort()
f1.sort()

ans = max((f0[-1] - f0[0]), (f1[-1] - f1[0]))
print(ans)
n = int(input())
f0, f1 = [0] * n, [0] * n
for i in range(n):
    x, y = map(int, input().split())
    f0[i] = x - y
    f1[i] = x + y
print(max(max(f0) - min(f0), max(f1) - min(f1)))
n=int(input())

minx=10**10
maxx=-10**10
miny=10**10
maxy=-10**10

for _ in range(n):
    x,y=map(int,input().split())

    maxx=max(maxx,x+y)
    minx=min(minx,x+y)
    maxy=max(maxy,x-y)
    miny=min(miny,x-y)

print(max(maxx-minx,maxy-miny))
#coding:utf-8

N = int(input())

sa_lis = []
wa_lis = []

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

sa = max(sa_lis) - min(sa_lis)
wa = max(wa_lis) - min(wa_lis)

ans = max(sa,wa)

print("{}".format(ans))
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()
ans = max(a[-1] - a[0], b[-1] - b[0])
print(ans)
n=int(input())
zl,wl=[],[]
for i in range(n):
    x,y=map(int,input().split())
    z=x+y
    w=x-y
    zl.append(z)
    wl.append(w)
zl.sort()
wl.sort()
print(max(zl[-1]-zl[0],wl[-1]-wl[0]))
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

n = int(input())
point = []
p = []
m = []
for i in range(n):
    a,b = mp()
    point.append((a,b))
    p.append(a+b)
    m.append(a-b)
print(max(max(p)-min(p), max(m)-min(m)))
N = int(input())
xy = [tuple(map(int, input().split())) for i in range(N)]

F = [0]*N

for i in range(N):
    F[i] = xy[i][0] - xy[i][1]
ans = max(F) - min(F)

for i in range(N):
    F[i] = xy[i][0] + xy[i][1]
ans2 = max(F) - min(F)

print(max(ans, ans2))
import numpy as np

n = int(input())
xy = np.array([list(map(int,input().split())) for _ in range(n)],int)

x = xy[:,0]
y = xy[:,1]

a = x+y
b = -x+y

ans = max(a.max() - a.min(), b.max()-b.min())
print(ans)
from sys import stdin
input = stdin.readline

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

z = []
w = []

for x, y in xy:
    z.append(x + y)
    w.append(x - y)

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

print(ans)
def main():
    import sys
    N=int(sys.stdin.readline())

    xpy=[]
    xmy=[]

    for i in range(N):
        x,y=list(map(int,sys.stdin.readline().split()))
        xpy.append(x+y)
        xmy.append(x-y)

    t1=max(xpy)-min(xpy)
    t2=max(xmy)-min(xmy)

    print(max(t1,t2))

main()
import sys
def input(): return sys.stdin.readline().rstrip()

N = int(input())
X = []
Y = []
for i in range(N):
    x,y = map(int,input().split())
    X.append(x)
    Y.append(y)

ans1 = []
ans2 = []
for i in range(N):
    ans1.append(X[i] + Y[i])
    ans2.append(Y[i] - X[i])
ans1.sort()
ans2.sort()

a = ans1[-1] - ans1[0]
b = ans2[-1] - ans2[0]

print(max(a,b))
n = int(input())
fx_list = []
fy_list = []

for i in range(n):
    x,y = (int(x) for x in input().split())
    fx_list.append(x-y)
    fy_list.append(x+y)

a = max(fx_list) - min(fx_list)
b = max(fy_list) - min(fy_list)

print(max([a,b]))
N = int(input())
M0 = M1 = -float('inf')
m0 = m1 = float('inf')

for _ in range(N):
    x, y = map(int, input().split())
    M0 = max(M0, x - y)
    m0 = min(m0, x - y)
    M1 = max(M1, x + y)
    m1 = min(m1, x + y)

print(max(M0 - m0, M1 - m1))
n=int(input())
xy=[[0]*n,[0]*n,[0]*n,[0]*n]
for i in range(n):
  x,y=map(int,input().split())
  xy[0][i]=x+y
  xy[1][i]=x-y
  xy[2][i]=-x+y
  xy[3][i]=-x-y
print(max(max(xy[0])-min(xy[0]),max(xy[1])-min(xy[1]),max(xy[2])-min(xy[2]),max(xy[3])-min(xy[3])))
n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

L1 = [i[0] + i[1] for i in xy]
L2 = [i[0] - i[1] for i in xy]

m1 = max(L1) - min(L1)
m2 = max(L2) - min(L2)

print( max(m1, m2) )
N=int(input())

xp=yp=0
xn=yn=10**9
zs=[0]*N
ws=[0]*N
for i in range(N):
    xi,yi=map(int,input().split())
    zs[i]=xi+yi
    ws[i]=xi-yi
zs.sort()
ws.sort()
ans=max(zs[-1]-zs[0],ws[-1]-ws[0])
print(ans)
n=int(input())
num=[list(map(int,input().split())) for _ in range(n)]
n1=[]
num1=10**9
ans=0
for i in range(n):
    n1.append(num[i][0]+num[i][1])
ans=max(ans,max(n1)-min(n1))
n1=[]
for i in range(n):
    n1.append(num1-num[i][0]+num[i][1])
ans=max(ans,max(n1)-min(n1))
print(ans)
n = int(input())

min_x = 10 ** 9
max_x = -(10 ** 9)
min_y = 10 ** 9
max_y = -(10 ** 9)

for i in range(n):
    a, b = map(int, input().split())
    x = a + b
    y = a - b
    min_x = min(min_x, x)
    max_x = max(max_x, x)
    min_y = min(min_y, y)
    max_y = max(max_y, y)

print(max(max_x - min_x, max_y - min_y))
N = int(input())

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

ans1 = max(plus) - min(plus)
ans2 = max(minus) - min(minus) 

print(max(ans1,ans2))
N=int(input())
xx=[]
yy=[]
for i in range(N):
  x,y=map(int,input().split())
  xx.append(x+y)
  yy.append(x-y)
xx.sort()
yy.sort()
print(max(xx[-1]-xx[0],yy[-1]-yy[0]))
N = int(input())
XY = [[int(_) for _ in input().split()] for _ in range(N)]
ans = -1
for dx, dy in ((1, 1), (-1, 1), (-1, -1), (1, -1)):
    xy2 = sorted(x * dx + y * dy for x, y in XY)
    ans = max(ans, max(xy2) - min(xy2))
print(ans)
def main():
    point_count = int(input())
    sums = set()
    diffs = set()
    for _ in range(point_count):
        x, y = [int(x) for x in input().split()]
        sums.add(x + y)
        diffs.add(x - y)
    pat_sum = max(sums) - min(sums)  # max (Xi + Yi) - (Xj + Yj)
    pat_diff = max(diffs) - min(diffs)  # max (Xi - Yi) - (Xj - Yj)
    return max(pat_sum, pat_diff)


if __name__ == '__main__':
    print(main())
N = int(input())

p_list = []
for i in range(N):
  x, y = map(int, input().split())
  p_list.append((x, y))

f0_list = [x+y for x, y in p_list]
f1_list = [x-y for x, y in p_list]

max_f0 = max(f0_list) - min(f0_list)
max_f1 = max(f1_list) - min(f1_list)

print(max([max_f0, max_f1]))
N = int(input())
plus = []
minus = []
for i in range(N):
    x,y = map(int,input().split())
    plus.append(x+y)
    minus.append(x-y)
plus.sort()
minus.sort()

ans_1 = plus[-1]-plus[0]
ans_2 = abs(minus[-1]-minus[0])
print(max(ans_1,ans_2))
import numpy as np

N = int(input())
XY = []
for i in range(N):
  XY.append([int(i) for i in input().split()])

XY = np.array(XY)
X = XY[:,0]
Y = XY[:,1]
pxpy = X + Y
pxmy = X - Y
mxpy =-X + Y
mxmy =-X - Y

candi = [np.argmax(pxpy),np.argmax(pxmy),np.argmax(mxpy),np.argmax(mxmy)]

cand = [XY[candi[i]] for i in range(4)]
manh = [abs(cand[0][0] - cand[3][0]) + abs(cand[0][1] - cand[3][1]), abs(cand[1][0] - cand[2][0]) + abs(cand[1][1] - cand[2][1])]
print(max(manh))
n=int(input())
p=[]
m=[]

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

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())
lx=[]
ly=[]
for i in range(n):
  x,y=map(int,input().split())
  lx.append(x+y)
  ly.append(x-y)
print(max(max(lx)-min(lx),max(ly)-min(ly)))
n = int(input())
z = []
w = []

for i in range(n):
    x, y = 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())
x = []
y = []
for i in range(N):
    a = tuple(map(int, input().split()))
    x.append(a[0] + a[1])
    y.append(a[0] - a[1])

x.sort()
y.sort()

print(max(abs(y[0] - y[-1]), abs(x[-1] - x[0])) if x and y else abs(x[-1] - x[0]) if x else abs(y[0] - y[-1]))
n=int(input())
ans=0
xway=[]
xsay=[]
for i in range(n):
  t1,t2=map(int,input().split())
  xway.append(t1+t2)
  xsay.append(t1-t2)
xway.sort()
xsay.sort()
ans=max(ans,xway[-1]-xway[0])
ans=max(ans,xsay[-1]-xsay[0])
print(ans)
n = int(input())
x = []
y = []
for i in range(n):
    tmp_x, tmp_y = list(map(int, input().split()))
    x.append(tmp_x + tmp_y)
    y.append(tmp_x - tmp_y)
    
max_x = max(x) - min(x)
max_y = max(y) - min(y)
print(max(max_x, max_y))
def main():
    point_count = int(input())
    sums = []
    diffs = []
    for _ in range(point_count):
        x, y = [int(x) for x in input().split()]
        sums.append(x + y)
        diffs.append(x - y)
    pat_sum = max(sums) - min(sums)  # max (Xi + Yi) - (Xj + Yj)
    pat_diff = max(diffs) - min(diffs)  # max (Xi - Yi) - (Xj - Yj)
    return max(pat_sum, pat_diff)


if __name__ == '__main__':
    print(main())
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())

INF = float('inf')

plusmax = minusmax =-INF
plusmin = minusmin = INF

for i in range(n):
    x, y = map(int, input().split())

    x_minus_y = x-y
    x_plus_y = x+y

    plusmax = max(plusmax, x_plus_y)
    plusmin = min(plusmin, x_plus_y)
    minusmax = max(minusmax, x_minus_y)
    minusmin = min(minusmin, x_minus_y)

ans0 = plusmax - plusmin
ans1 = minusmax - minusmin
print( max(ans0, ans1))
import sys
input=sys.stdin.readline
n=int(input())
ab=[]
A=-1e20
B=-1e20
C=1e20
D=1e20
for i in range(n):
	x,y=map(int,input().split())
	A=max(A,x+y)
	B=max(B,x-y)
	C=min(C,x+y)
	D=min(D,x-y)
print(max(A-C,B-D))
N = int(input())
a = []
b = []
for i in range(N):
    x,y = (list(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 _ in range(n):
  x,y=map(int,input().split())
  a+=[x-y]
  b+=[x+y]
a.sort()
b.sort()
print(max(a[-1]-a[0],b[-1]-b[0]))
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

p1 = []
p2 = []
p3 = []

for i in range(N):
    p1.append(xy[i][0] + xy[i][1])
    p2.append(xy[i][0] - xy[i][1])
    p3.append(-xy[i][0] + xy[i][1])

p1_r = max(p1) - min(p1)
p2_r = max(p2) - min(p2)
p3_r = max(p3) - min(p3)

print(max(p1_r, p2_r, p3_r))
N = int(input())
X, Y = zip(*[[int(a) for a in input().split()] for _ in range(N)])

L = [(x, y, x + y, y - x) for x, y in zip(X, Y)]

L.sort(key = lambda a : a[2])  # x+yでソート
ans = abs(L[0][0] - L[-1][0]) + abs(L[0][1] - L[-1][1])

L.sort(key = lambda a : a[3])  # y-xでソート
ans = max(ans, abs(L[0][0] - L[-1][0]) + abs(L[0][1] - L[-1][1]))
print(ans)
n = int(input())
answer1 = 0
answer2 = 0
answer = 0
a = [0]*n
b = [0]*n
x = 0
y = 0
for i in range(n):
  x,y = map(int,input().split())
  a[i] = x-y
  b[i] = x+y
answer1 = max(a)-min(a)
answer2 = max(b)-min(b)
print(max(answer1,answer2))
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()

answer = max(a[-1] - a[0], b[-1] - b[0])
print(answer)
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())

l1 = []
l2 = []

for i in range(n):
    x1,y1 = map(int,input().split())
    l1.append(x1-y1)
    l2.append(x1+y1)

l1 = sorted(l1)
l2 = sorted(l2)
a = l1[-1]
b = l1[0]
c = l2[-1]
d = l2[0]
ans = max(a-b, c-d)
print(ans)
n = int(input())
LIST=[list(map(int,input().split()))for i in range(n)]

plus=[i[0]+i[1]for i in LIST]
minus=[i[0]-i[1]for i in LIST]

d_plus=max(plus)-min(plus)
d_minus=max(minus)-min(minus)

print(max(d_plus, d_minus))
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
for i in range(N):
  XY[i] = [XY[i][0] - XY[i][1], XY[i][0] + XY[i][1]]
X = [XY[i][0] for i in range(N)]
Y = [XY[i][1] for i in range(N)]
X.sort()
Y.sort()
print(max(X[-1] - X[0], Y[-1] - Y[0]))
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 20:41:42 2020

@author: liang
"""
#E
N = int(input())
d = list()
for i in range(N):
    x, y = map(int,input().split())
    d.append((x,y))

d.sort(key=lambda x:x[0]+x[1])
#print(d)

ans1 = abs(d[0][0] - d[N-1][0]) + abs(d[0][1] - d[N-1][1])

d.sort(key=lambda x:x[0]-x[1])

ans2 = abs(d[0][0] - d[N-1][0]) + abs(d[0][1] - d[N-1][1])

ans = max(ans1, ans2)

print(ans)
n = int(input())
d0 = []
d1 = []
for i in range(n):
  xi,yi = map(int,input().split())
  d0.append(xi-yi)
  d1.append(xi+yi)
print(max(max(d0)-min(d0),max(d1)-min(d1)))
n = int(input())
xy = []
for _ in range(n):
    x,y = map(int,input().split())
    xy.append((x,y))
    
al,be = 1000000000,1000000000
f = [(1,1),(1,-1),(-1,1),(-1,-1)]
ans = -1145141919810364

for k,l in f:
    alfa = al * k
    beta = be * l
    man = []
    for i,j in xy:
        man.append(abs(alfa-i) + abs(beta-j))
    ans = max(ans,max(man) - min(man))
    
print(ans)
n = int(input())
point = []
ans = -1
for i in range(n):
    point.append(list(map(int, input().split())))
x_sub_y = []
x_plus_y = []
for i in range(n):
    x_sub_y.append(point[i][0] - point[i][1])
    x_plus_y.append(point[i][0] + point[i][1])
x_sub_y.sort()
x_plus_y.sort()
ans = max(ans, x_sub_y[-1] - x_sub_y[0], x_plus_y[-1] - x_plus_y[0])
print(ans)
N = int(input())
ls = []
lt= []
for _ in range(N):
    x,y = map(int, input().split())
    s = x+y
    t = x-y

    ls.append(s)
    lt.append(t)

print(max(max(ls) - min(ls),max(lt) - min(lt)))
n = int(input())
x,y = map(int,input().split())
max_xpy = x+y
min_xpy = x+y
max_xmy = x-y
min_xmy = x-y
for i in range(n-1):
  x,y = map(int,input().split())
  max_xpy = max(max_xpy,x+y)
  min_xpy = min(min_xpy,x+y)
  max_xmy = max(max_xmy,x-y)
  min_xmy = min(min_xmy,x-y)
print(max(max_xpy-min_xpy,max_xmy-min_xmy))
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XplusY = [x + y for x, y in XY]
XminusY = [x - y for x, y in XY]

print(max([max(XplusY) - min(XplusY), max(XminusY) - min(XminusY)]))
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,b=max(A)-min(A),max(B)-min(B)
print(max(a,b))
N,*f = map(int, open(0).read().split())
xy = [f[i*2:i*2+2] for i in range(N)]
s = [sum(z) for z in xy]
a = max(s) - min(s)
t = [z[0]-z[1] for z in xy]
b = max(t) - min(t)
print(max(a,b))
N = int(input())
a = - (10 ** 9 + 3)  # max(x + y)
b = 10 ** 9 + 3  # min(x + y)
c = - (10 ** 9 + 3)  # max(x - y)
d = 10 ** 9 + 3  # min(x - y)
for i in range(N):
    x, y = map(int, input().split())
    a = max(a, x + y)
    b = min(b, x + y)
    c = max(c, x - y)
    d = min(d, x - y)
ans = max([a - b, c - d])
print(ans)
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), (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)
def e_dist_max():
    N = int(input())
    Pos_z, Pos_w = [], []  # editorial に準ずる
    for _ in range(N):
        x, y = [int(i) for i in input().split()]
        Pos_z.append(x + y)
        Pos_w.append(x - y)
    Pos_z.sort()
    Pos_w.sort()
    return max(Pos_z[-1] - Pos_z[0], Pos_w[-1] - Pos_w[0])

print(e_dist_max())
N = int(input())
x = [0]*N
y = [0]*N
f_0 = [0]*N
f_1 = [0]*N
for i in range(N):
    x[i],y[i] = map(int, input().split())
    f_0[i] = x[i] - y[i]
    f_1[i] = x[i] + y[i]
    
print(max(max(f_0)-min(f_0),max(f_1)-min(f_1)))
n=int(input())
a=[]
b=[]

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

mnp=min(a)
mxp=max(a)
mnm=min(b)
mxm=max(b)

res=[mxp-mnp,mxm-mnm,mnm,mxm,mnp-mxp]
print(max(res))
beforex_plus_y=[]
beforex_minus_y=[]
for i in range(int(input())):
  xy=list(map(int,input().split()))
  beforex_plus_y.append(xy[0]+xy[1])
  beforex_minus_y.append(xy[0]-xy[1])

print(max(max(beforex_plus_y)-min(beforex_plus_y),max(beforex_minus_y)-min(beforex_minus_y)))
n = int(input())
dist = []
max1 = -pow(10, 11)
min1 = pow(10, 11)
max2 = -pow(10, 11)
min2 = pow(10, 11) 
for i in range(n):
    x, y = (int(x) for x in input().split())
    if max1 < x + y:
        max1 = x + y
    if min1 > x + y:
        min1 = x + y
    if max2 < x - y:
        max2 = x - y
    if min2 > x - y:
        min2 = x - y
print(max(max1-min1, max2-min2))
n = int(input())
# マンハッタン距離
# 45度回転
z = []
w = []
for i in range(n):
    x, y = map(int, input().split())
    z.append(x + y)
    w.append(x - y)
z.sort()
w.sort()
print(max(z[-1]-z[0], w[-1]-w[0]))
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
mod = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

def inverse(N, mod):
	return (pow(N, mod - 2, mod))

def main():
	N = int(input())
	L1 = []
	L2 = []	
	for i in range(N):
		x, y = getlist()
		L1.append(x + y)
		L2.append(x - y)
	L1.sort()
	L2.sort()
	ans1 = L1[-1] - L1[0]
	ans2 = L2[-1] - L2[0]
	ans = max(ans1, ans2)
	print(ans)


if __name__ == '__main__':
	main()
N = int(input())

X = []
Y = []

P = []
Q = []

for i in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
    P.append(x + y)
    Q.append(x - y)

print(max(max(P) - min(P), max(Q) - min(Q)))
n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]

w = [xy[i][0] - xy[i][1] for i in range(n)]
z = [xy[i][0] + xy[i][1] for i in range(n)]
print(max((max(w) - min(w)), (max(z)-min(z))))
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

MAX_P = 0
MIN_P = 10 ** 10
MAX_M = -(10 ** 10)
MIN_M = 10 ** 10

for x, y in XY:
    P = x + y
    M = x - y

    MAX_P = max(MAX_P, P)
    MIN_P = min(MIN_P, P)

    MAX_M = max(MAX_M, M)
    MIN_M = min(MIN_M, M)

ans = max(MAX_P - MIN_P, MAX_M - MIN_M)

print(ans)
import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

n = ri()
a = []
for i in range(n):
    x,y = rl()
    a.append((x,y, x+y))
a = sorted(a, key=lambda x: x[2])
print(abs(a[-1][0]- a[0][0]) + abs(a[-1][1]-a[0][1]))
import math as mt
import sys
import bisect
input=sys.stdin.readline
#t=int(input())
t=1

mod=10**9+7
for _ in range(t):
    
    n=int(input())
    l=[]
    for i in range(n):
        x,y=map(int,input().split())
        l.append(x+y)
    
    #u1,d1=map(int,input().split())
    #u2,d2=map(int,input().split())
    #l=list(map(int,input().split()))
    l.sort()
    print(l[-1]-l[0])
n = int(input())
x_y = [[] for i in range(n)]
for i in range(n):
	x_y[i] = list(map(int, input().split()))

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

#print(x_)
ans = 0
for l in range(n):
	for r in range(n-1,l,-1):
#		print(l,r)
		kyori = (x_[r][0] - x_[l][0]) + (x_[r][1] - x_[l][1])
		if kyori < 0:
			kyori = -kyori
		print(kyori)
		if kyori > ans:
			ans = kyori
print(ans)
n=int(input())
x=[]
for i in range(n):
  x.append(list(map(int, input().split())))
a=2*(10**9)
b=0

for j in range(n):
  if sum(x[j])<a:
    a=sum(x[j])
    c=j
  if sum(x[j])>b:
    b=sum(x[j])
    d=j
if c==d:
  print(0)
else:
  print(x[d][0]-x[c][0]+x[d][1]-x[c][1])
n = int(input())

dist = []

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

dist.sort()

print(abs(dist[0] - dist[-1]))
N = int(input())
A = 0
Xmin = Ymin = 1e9 + 5
Xmax = Ymax = 0
for _ in range(N):
    x, y = map(int, input().split())
    X = x + y
    Y = abs(x - y)
    Xmin = min(Xmin, X)
    Xmax = max(Xmax, X)
    Ymin = min(Ymin, Y)
    Ymax = max(Ymax, Y)
if Xmin == 1e9 + 5:
    Xmin = Xmax
if Ymin == 1e9 + 5:
    Ymin = Ymax
Z = max(Xmax - Xmin, Ymax - Ymin)
print(Z)
N = int(input())

for i in range(N):
  x, y = map(int, input().split())
  if i==0:
    x1, y1, x2, y2, x3, y3, x4, y4 = x, y, x, y, x, y, x, y
  else:
    if x<x1 and y<y1:
      x1, y1 = x, y
    elif x<x2 and y>y2:
      x2, y2 = x, y
    elif x>x3 and y>y3:
      x3, y3 = x, y
    elif x>x4 and y<y4:
      x4, y4 = x, y
print(max(abs(x1-x3)+abs(y1-y3),abs(x2-x4)+abs(y2-y4)))
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

n = int(readline())

p = [list(map(int,readline().split())) for i in range(n)]

xmin = INF
ymin = INF

for (x,y) in p:
    xmin = min(x,xmin)
    ymin = min(y,ymin)

for i in range(n):
    p[i][0] -= xmin
    p[i][1] -= ymin

dmax = -INF
dmin = INF

for (x,y) in p:
    dmax = max(dmax, x+y)
    dmin = min(dmin, x+y)

print(dmax-dmin)
n = int(input())
lst = []
for _ in range(n):
    x, y = map(int, input().split())
    lst.append([x+y, x, y])

lst.sort()
print(lst[-1][0] - lst[0][0])
n = int(input())
a = []
b = []

for i in range(n):
    x , y = map(int,input().split());
    a.append(x + y)
    b.append(abs(x - y))

aa = max(a)-min(a)
bb = max(b)-min(b)

if aa >= bb:
    print(aa)
else:
    print(bb)
N=int(input())
xy=[]
for i in range(N):
    x,y=map(int,input().split())
    xy.append([x,y,x**2+y**2])
xy=sorted(xy,key=lambda x:x[2])
print(abs(xy[0][0]-xy[-1][0])+abs(xy[0][1]-xy[-1][1]))