peterverebics/CodeNet_Python_118 huggingface dataset:
n=int(input())
a_list=[list(map(int,input().split())) for _ in range(n)]

f_list_0 = []
f_list_1 = []
for i in range(n):
    f_list_0.append(a_list[i][0]+a_list[i][1])
    f_list_1.append(a_list[i][0]-a_list[i][1])

ans_0 = max(f_list_0) - min(f_list_0)
ans_1 = max(f_list_1) - min(f_list_1)

print(max((ans_0, ans_1)))
N=int(input())
xy=[]
xmax,xmin,ymax,ymin = -10**10,10**10,-10**10,10**10
for i in range(N):
  x,y=map(int,input().split())
  xmax = max(xmax,x+y)
  ymax = max(ymax,x-y)
  xmin = min(xmin,x+y)
  ymin = min(ymin,x-y)
print(max(xmax-xmin,ymax-ymin))
import sys
readline = sys.stdin.readline

N = int(readline())
X,Y = [None] * N, [None] * N
for i in range(N):
  x,y = map(int,readline().split())
  X[i],Y[i] = x + y,x - y

print(max(abs(max(X) - min(X)),abs(max(Y) - min(Y))))
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    xy = [list(map(int, rl().split())) for _ in range(N)]
    
    a = [xi + yi for xi, yi in xy]
    a.sort()
    b = [xi - yi for xi, yi in xy]
    b.sort()
    ans = max(a[-1] - a[0], b[-1] - b[0])
    print(ans)


if __name__ == '__main__':
    solve()
N = int(input())
add = []
diff = []
for _ in range(N):
    x, y = list(map(int, input().split()))
    add.append(x+y)
    diff.append(x-y)
add.sort()
diff.sort()
print(max(add[-1]-add[0], diff[-1]-diff[0]))
n = int(input())
xy = [[int(i) for i in input().split()] for j in range(n)]

mi = 10**10
ma = 0

for i in range(n):
    tmp = xy[i][0] + xy[i][1]
    if tmp > ma:
        ma = tmp
    #print(tmp,mi)
    if tmp < mi:
        mi = tmp
        
ans = ma-mi

mi = 10**10
ma = -10**10

for i in range(n):
    tmp = xy[i][0] - xy[i][1]
    if tmp > ma:
        ma = tmp
    #print(tmp,mi)
    if tmp < mi:
        mi = tmp
        
print(max(ans,ma-mi))
n=int(input())
z=[]
w=[]
for i 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())
A = 0
Xmin = Ymin = 3e9 + 5
Xmax = Ymax = -3e9 - 5
for _ in range(N):
    x, y = map(int, input().split())
    X = x + y
    Y = x - y
    Xmin = min(Xmin, X)
    Xmax = max(Xmax, X)
    Ymin = min(Ymin, Y)
    Ymax = max(Ymax, Y)
if Xmin == 3e9 + 5:
    Xmin = Xmax
if Ymin == 3e9 + 5:
    Ymin = Ymax
if Xmax == -3e9 - 5:
    Xmax = Xmin
if Ymax == -3e9 -5:
    Ymax = Ymin
Z = max(Xmax - Xmin, Ymax - Ymin)
print(Z)
N = int(input())
G = []
for i in range(N):
    x,y = map(int,input().split())
    G.append([x,y])

a = -10**10
b = 10**10
c = -10**10
d = 10**10

for i in range(N):
    x = G[i][0]
    y = G[i][1]
    t = x+y
    u = x-y
    a = max(a,t)
    b = min(b,t)
    c = max(c,u)
    d = min(d,u)

#print(a,b,c,d)
ans = max(a-b,c-d)
print(ans)
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())
XY = [list(map(int, input().split())) for _ in range(N)]
U = [x+y for x, y in XY]
V = [x-y for x, y in XY]
min_u = min(U)
max_u = max(U)
min_v = min(V)
max_v = max(V)
print(max(
    max_u - min_u,
    max_v - min_v
))
#!/usr/bin/env pypy3

from sys import stdin, stdout
 
def input():
    return stdin.readline().strip()

sum = []
dif = []

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

    sum += [x+y]
    dif += [x-y]

ans1 = max(sum) - min(sum)
ans2 = max(dif) - min(dif)

print(max(ans1, ans2))
import sys

def f(x,y):
    return x-y,x+y

def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    x = [0]*n
    y = [0]*n
    for i in range(n):
        x[i],y[i] = map(int,input().split())
    f0 = [0]*n
    f1 = [0]*n
    for i in range(n):
        f0[i],f1[i] = f(x[i],y[i])
    print(max(max(f0)-min(f0),max(f1)-min(f1)))

if __name__ == "__main__":
    main()
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())
a = []
b = []
for i in range(n):
    a.append(x[i]-y[i])
    b.append(x[i]+y[i])
c = max(a) - min(a)
d = max(b) - min(b)
print(max(c,d))
n = int(input())
a, b = [], []

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

ans = max(max(a) - min(a), max(b) - min(b))
print(ans)
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

for i in range(n):
  buf = x[i]
  x[i] = x[i]+y[i]
  y[i] = buf-y[i]

dx = max(x) - min(x)
dy = max(y) - min(y)
  
print(max(dx,dy))
def main():
    N = int(input())
    d1 = []
    d2 = []
    for _ in range(N):
        x, y = map(int, input().split())
        d1.append(x+y)
        d2.append(x-y)
    d1_dist = max(d1) - min(d1)
    d2_dist = max(d2) - min(d2)
    print(max([d1_dist, d2_dist]))

if __name__ == '__main__':
    main()
import sys
input = lambda: sys.stdin.readline().rstrip()
N = int(input())
X = []
for _ in range(N):
    x, y = map(int, input().split())
    X.append((x * 2, y * 2))
X = sorted(X, key = lambda x: -x[1])
x0, y0 = X[0]
ans = 0
for x, y in X[1:]:
    ans = max(ans, y0 - y + abs(x - x0))
    a = (abs(x - x0) - (y0 - y)) // 2
    if a < 0: continue
    x0 += a if x0 < x else -a
    y0 += a
print(ans // 2)
n=int(input())
z_max,z_min=-10**10,10**10
w_max,w_min=-10**10,10**10
for i in range(n):
    a,b=map(int,input().split())
    z=a+b
    w=a-b
    z_max=max(z_max,z)
    z_min=min(z_min,z)
    w_max=max(w_max,w)
    w_min=min(w_min,w)
print(max(z_max-z_min,w_max-w_min))
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    a, b = map(int, input().split())
    x[i]=a+b
    y[i]=a-b
xmax=max(x)
xmin=min(x)
ymax=max(y)
ymin=min(y)
print(max(xmax-xmin,ymax-ymin))
import numpy as np
N = int(input())
max_z = -np.Inf
min_z = np.inf
max_w = -np.Inf
min_w = np.inf
for _ in range(N):
    x, y = map(int, input().split())
    z = x + y
    w = x - y
    max_z = max(max_z, z)
    min_z = min(min_z, z)
    max_w = max(max_w, w)
    min_w = min(min_w, w)
print(max(max_z-min_z, max_w-min_w))
def func(x, y):
    res, n = 0, len(x)
    for p, q in [[1, 1], [1, -1], [-1, 1], [-1, -1]]:
        smallest = p * x[0] + q * y[0] + 0
        for i in range(n):
            cur = p * x[i] + q * y[i]
            res = max(res, cur - smallest)
            smallest = min(smallest, cur)
    return res

n = int(input())
x,y = [],[]
for i in range(n):
    a,b = list(map(int,input().split()))
    x.append(a)
    y.append(b)
print(func(x,y))
N = int(input())

Z = []
W = []

for i 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())
bignum=10**30
num1,num2,num3,num4=-bignum,bignum,-bignum,bignum
for i in range(n):
  x,y=map(int, input().split())
  num1=max(x+y,num1)
  num2=min(x+y,num2)
  num3=max(x-y,num3)
  num4=min(x-y,num4)
print(max(num1-num2,num3-num4))
n = int(input())

x = []
y = []

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

x.sort()
y.sort()

print(max(abs(x[0]-x[n-1]),abs(y[0]-y[n-1])))
N = int(input())

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

#f = [[0]*2 for i in range(N)]
X=[]
Y=[]
for i in range(N):
    #f[i][0] = x[i]-x[i]
    #f[i][1] = x[i]+y[i]
    X.append(x[i]-y[i])
    Y.append(x[i]+y[i])

dam1 = max(X) - min(X)
dam2 = max(Y) - min(Y)
print(max(dam1,dam2))
n=int(input())
zp=[]
zl=[]
for i in range(n):
    a,b=map(int,input().split())
    zp.append(a+b)
    zl.append(a-b)
ans=max((max(zp)-min(zp)),(max(zl)-min(zl)))
print(ans)
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,*xy = map(int,read().split())

wa = []
sa = []
for x,y in zip(xy[::2],xy[1::2]):
    wa.append(x+y)
    sa.append(x-y)

v = max(wa)-min(wa)
w = max(sa)-min(sa)

print(max(v,w))
#!/usr/bin/env python3

def main():
    n = int(input())
    xy = [list(map(int, input().split())) for i in range(n)]
    max_z, max_w, min_z, min_w = -10**20, -10**20, 10**20, 10**20
    ans = 0
    for p in xy:
        max_z, max_w = max(max_z, p[0] + p[1]), max(max_w, p[0] - p[1])
        min_z, min_w = min(min_z, p[0] + p[1]), min(min_w, p[0] - p[1])
    ans = max(max_z - min_z, max_w - min_w)
    print(ans)


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


ans = -float("inf")

left = -float("inf")
right = float("inf")
for i in range(N):
    left = max(left, X[i]-Y[i])
    right = min(right, X[i]-Y[i])

ans = max(ans, left - right)

left = -float("inf")
right = float("inf")
for i in range(N):
    left = max(left, X[i]+Y[i])
    right = min(right, X[i]+Y[i])

ans = max(ans, left - right)

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

xy1 = max(x + y for x, y in xy)
xy2 = max(-x - y for x, y in xy)
xy3 = max(-x + y for x, y in xy)
xy4 = max(x - y for x, y in xy)

print(max(xy1 + xy2, xy3 + xy4))
import sys
from operator import itemgetter

N = int(input())
V = set()
for s in sys.stdin.readlines():
    x, y = map(int, s.split())
    V.add((x + y, x - y))

y1 = max(V, key=itemgetter(1))[1]
y2 = min(V, key=itemgetter(1))[1]
x1 = max(V, key=itemgetter(0))[0]
x2 = min(V, key=itemgetter(0))[0]

print(max(abs(x1 - x2), abs(y1 - y2)))
n = int(input())

xy_sum = []
xy_dif = []
for i in range(n) :
    x, y = map(int, input().split())
    xy_sum.append(x + y)
    xy_dif.append(x - y)

print(max(abs(max(xy_sum) - min(xy_sum)), abs(max(xy_dif) - min(xy_dif))))
N = int(input())

points_pp = []
points_pn = []
points_np = []
points_nn = []
for _ in range(N):
  x, y = map(int, input().split())
  points_pp.append(x+y)
  points_nn.append(-x-y)
  
  points_pn.append(x-y)
  points_np.append(-x+y)
  
ans_pp = max(points_pp) - min(points_pp)  
ans_pn = max(points_pn) - min(points_pn)  
ans_np = max(points_np) - min(points_np)  
ans_nn = max(points_nn) - min(points_nn)
print(max(ans_pp, ans_pn, ans_np, ans_nn))
N=int(input())
axis1=[]
axis2=[]
for i in range(N):
    x,y = map(int,input().split())
    axis1.append(x-y)
    axis2.append(x+y)

ans1 = max(axis1)-min(axis1)
ans2 = max(axis2)-min(axis2)

print(max(ans1,ans2))
n = int(input())
i = []
for z in range(n):
    i.append([int(s) for s in input().split()])

ur = [ind[0]+ind[1] for ind in i]
ul = [ind[0]-ind[1] for ind in i]
print(max([max(ur)-min(ur), max(ul)-min(ul)]))
n = int(input())
zm = -2e10
zn = 30000000000
wm = -2e10
wn = 30000000000
while(n):
  x,y = map(int,input().split())
  zm = max(zm,x+y)
  zn = min(zn,x+y)
  wm = max(wm,x-y)
  wn = min(wn,x-y)
  n-=1
  
print(max(zm-zn,wm-wn))
N=int(input())

xy = []
d0, d1 = [],[]
for _ in range(N):
  x,y=map(int,input().split())
  d0.append(x-y)
  d1.append(x+y)
print(max(max(d0)-min(d0), max(d1)-min(d1)))
N = int(input())
X = []
Y = []
for i in range(N):
    x, y = map(int, input().split())
    X.append(x + y)
    Y.append(x - y)
# print(X, Y)

maxX = max(X)
maxY = max(Y)
minX = min(X)
minY = min(Y)

ans = max(maxX - minX, maxY - minY)
print(ans)
n = int(input())
x = []
y = []
for _ in range(n):
    X,Y = map(int,input().split())
    x.append(X)
    y.append(Y)

res = 0
for p, q in [[1, 1], [1, -1], [-1, 1], [-1, -1]]:
    smallest = p * x[0] + q * y[0] + 0
    for i in range(n):
        cur = p * x[i] + q * y[i]
        res = max(res, cur - smallest)
        smallest = min(smallest, cur)
print(res)
N=int(input())
XY=[list(map(int,input().split())) for i in range(N)]
a,b,c,d=-10**10,10**10,-10**10,10**10
l=[0]*4
for x,y in XY:
    if x+y>a: a=x+y;l[0]=(x,y)
    if x+y<b: b=x+y;l[1]=(x,y)
    if x-y>c: c=x-y;l[2]=(x,y)
    if x-y<d: d=x-y;l[3]=(x,y)
from itertools import combinations
print(max([abs(p[0]-q[0])+abs(p[1]-q[1]) for p,q in combinations(l,2)]))
n=int(input())
a=[]
b=[]
c=[]
d=[]
for i in range(n):
    k,l=map(int,input().split())
    a.append((k-l,i))
    b.append((k+l,i))
    c.append((-k-l,i))
    d.append((-k+l,i))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
d.sort(reverse=True)
print(max(a[0][0]+d[0][0],b[0][0]+c[0][0]))
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = []
b = []
for _ in range(n):
    x,y = inpl()
    a.append(x+y)
    b.append(x-y)
print(max(max(a)-min(a), max(b)-min(b)))
n = int(input())
xy_array = [list(map(int, input().split())) for _ in range(n)]

th = pow(10, 9)
right_up_max = -th
left_down_min = th
left_up_max = -th
right_down_min = th

for x, y in xy_array:
    right_up_max = max(x + y, right_up_max)
    left_down_min = min(x + y, left_down_min)
    left_up_max = max(x - y, left_up_max)
    right_down_min = min(x - y, right_down_min)

ans = max(right_up_max - left_down_min, left_up_max - right_down_min)
print(ans)
n = int(input())
xpy = []
xmy = []
for i in range(n):
    x,y = map(int,input().split())
    xpy.append(x+y)
    xmy.append(x-y)
xpy.sort()
xmy.sort()
print(max(abs(xpy[0]-xpy[-1]),abs(xmy[0]-xmy[-1])))
N=int(input())
a,b,c,d=0,1e10,-1e10,1e10
for i in range(N):
  A,B=input().split()
  A=int(A)
  B=int(B)
  a=max(a,A+B)
  b=min(b,A+B)
  c=max(c,A-B)
  d=min(d,A-B)
print(max(abs(a-b),abs(c-d)))
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
a = [x+y for x,y in xy]
b = [x-y for x,y in xy]
ans = max(max(a)-min(a), max(b)-min(b))
print(ans)
N = int(input())
XY_set = set(tuple(map(int, input().split())) for _ in range(N))
N = len(XY_set)

XY45 = [(x + y, x - y) for x, y in XY_set]
ans = max(max(x for x, _ in XY45) - min(x for x, _ in XY45),
          max(y for _, y in XY45) - min(y for _, y in XY45))
print(ans)
N = int(input())

X = []
Y = []
ans = 0

for i in range(N):
    x, y = map(int, input().split())
    X.append(x+y)
    Y.append(x-y)
    
m = [max(X), max(Y)]
s = [min(X), min(Y)]
    
for i in range(2):
    ans = max(ans, m[i]-s[i])
    
print(ans)
n = int(input())
fx = [[0 for i in range(4)] for j in range(n)]

for i in range(n):
  x, y = map(int, input().split())
  fx[i][0] = x + y
  fx[i][1] = x - y
  fx[i][2] = - x + y
  fx[i][3] = - x - y

ans = 0
for j in range(4):
  saidai = -(10 ** 10)
  saisho = 10 ** 10
  for i in range(n):
    if saidai < fx[i][j]:
      saidai = fx[i][j]
    if saisho > fx[i][j]:
      saisho = fx[i][j]
  ans = max(ans, saidai - saisho)

print(ans)
N = int(input())

M1 = -10 ** 10
M2 = - 10 ** 10

m1 = 10 ** 10
m2 = 10 ** 10

for i in range(N):
  x, y = map(int, input().split())
  M1 = max(x + y, M1)
  m1 = min(x + y, m1)
  M2 = max(x - y, M2)
  m2 = min(x - y, m2)
print(max(M1 - m1, M2 - m2))
N = int(input())

x, y = [0]*N, [0]*N

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

maxZ, minZ = x[0] + y[0], x[0] + y[0]
maxW, minW = x[0] - y[0], x[0] - y[0]
for i in range(N):
    z = x[i] + y[i]
    w = x[i] - y[i]

    maxZ = max(maxZ, z)
    minZ = min(minZ, z)
    maxW = max(maxW, w)
    minW = min(minW, w)

ans = max(maxZ-minZ, maxW-minW)
print(ans)
N = int(input())
p = []
for _ in range(N):
    x, y = map(int, input().split())
    p.append((x, y))
p = sorted(p, key=lambda i: i[0] + i[1])
x1, y1 = p[0]
x2, y2 = p[-1]
res = abs((x1 + y1) - (x2 + y2))
p = sorted(p, key=lambda i: i[0] - i[1])
x1, y1 = p[0]
x2, y2 = p[-1]
res = max(abs((x1 - y1) - (x2 - y2)), res)
print(res)
N = int(input())

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

p = max(data1)-min(data1)
q = max(data2)-min(data2)

print(max(p,q))
import sys


N = int(sys.stdin.readline())
points = []
for _ in range(N):
    x, y = map(int, sys.stdin.readline().split())
    points.append((x, y))

f1 = []
f2 = []
for (x, y) in points:
    f1.append(x-y)
    f2.append(x+y)

ans = max(max(f1) - min(f1), max(f2) - min(f2))
print(ans)
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):
    x,y=list(map(int,input().split()))
    a.append(x+y)
    b.append(x-y)

aaa=min(a)
aaaa=max(a)
bbb=min(b)
bbbb=max(b)

ans=[]

ans.append(aaaa-aaa)
ans.append(bbbb-bbb)
ans.append(bbb)
ans.append(bbbb)
ans.append(aaa-aaaa)

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

a,b = max(w)-min(w),max(z)-min(z)
print(max(a,b))
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]))
import sys
input = sys.stdin.readline

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

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

min1 = 10 ** 10
min2 = 10 ** 10

ans = 0

for i in range(n):
  ans = max(ans, memo1[i]-min1)
  ans = max(ans, memo2[i]-min2)
  min1 = min(min1, memo1[i])
  min2 = min(min2, memo2[i])

print(ans)
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    X = [] # x+y
    Y = [] # x-y
    for i in range(N):
        x,y=mi()
        X.append(x+y)
        Y.append(x-y)
    
    X.sort()
    Y.sort()
    ans = max(X[-1]-X[0],Y[-1]-Y[0])

    print(ans)







if __name__ == "__main__":
    main()
n = int(input())
plus_max = 10**20 * -1
plus_min = 10**20
minus_max = 10**20 * -1
minus_min = 10**20
for _ in range(n):
    x, y = map(int, input().split())
    plus_max = max(plus_max, x + y)
    plus_min = min(plus_min, x + y)
    minus_max = max(minus_max, x - y)
    minus_min = min(minus_min, x - y)
print(max(plus_max - plus_min, minus_max - minus_min))
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

d = [0] * N
s = [0] * N
    
for i in range(N):
  d[i] = x[i] - y[i]
  s[i] = x[i] + y[i]


print(max(max(s)-min(s), max(d)-min(d)))
n = int(input())
X = [0] * n
Y = [0] * n
cx = []
cy = []

for i in range(n):
    X[i], Y[i] = map(int, input().split())
    cx.append(X[i] - Y[i])
    cy.append(X[i] + Y[i])

#print(X, Y)
#print(cx, cy)

ans = max(max(cx) - min(cx), max(cy) - min(cy))
print(ans)
import sys
def input():
    return sys.stdin.readline()[:-1]
N=int(input())
pa,ma=-10**10,-10**10
pi,mi=10**10,10**10
for i in range(N):
    x,y=map(int,input().split())
    s=x+y
    if s>pa:
        pa=s
    if s<pi:
        pi=s
    s=x-y
    if s>ma:
        ma=s
    if s<mi:
        mi=s
print(max(pa-pi,ma-mi))
n=int(input())
p=[]
for i in range(n):
    p.append(list(map(int,input().split())))
a=[]
b=[]
for i in range(n):
    a.append(p[i][0]+p[i][1])
    b.append(p[i][0]-p[i][1])
a.sort()
b.sort()
print(max(a[n-1]-a[0],b[n-1]-b[0]))
N = int(input())

lst = [[0, 0, 0, 0] for _ in range(N)]
p = [0] * N
m = [0] * N

for i in range(N):
  x, y = map(int, input().split())
  lst[i][0] = x
  lst[i][1] = y
  p[i] = x+y
  m[i] = x-y
  
d = max( max(p) - min(p), max(m) - min(m) )
print(d)
#!/usr/bin python3
# -*- coding: utf-8 -*-

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

ret = 0
ret = max(ret, max(u)-min(u))
ret = max(ret, max(v)-min(v))
print(ret)
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
inf = 10**18

N = int(input())
xmax = -inf
xmin = inf
ymax = -inf
ymin = inf
for _ in range(N):
    a, b = map(int, input().split())
    x = a + b
    y = a - b
    xmax = max(xmax, x)
    xmin = min(xmin, x)
    ymax = max(ymax, y)
    ymin = min(ymin, y)

print(max(xmax-xmin, ymax-ymin))
def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    N=int(input())
    A=[list(map(int,input().split())) for _ in range(N)]
    B=[]
    C=[]
    for x in A:
        B.append(x[0]+x[1])
        C.append(x[0]-x[1])
    b=max(B)-min(B)
    c=max(C)-min(C)
    d=[b,c]
    print(max(d))
    
   


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

xyp = []
xym = []

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

print(max(xyp[-1] - xyp[0], xym[-1] - xym[0]))
def max_min(val,pos):
  if val<abs_max[pos][0]:
    abs_max[pos][0]=val
  elif val>abs_max[pos][1]:
    abs_max[pos][1]=val
    

n=int(input())

abs_max=[[float('inf'),float('-inf')] for __ in range(4)]

for _ in range(n):
  x,y=map(int,input().split())
  max_min(x+y,0)
  max_min(x-y,1)
  max_min(-x+y,2)
  max_min(-x-y,3)
ans=0
for Min,Max in abs_max:
  ans=max(ans,Max-Min)
print(ans)
n = int(input())

max_diff = -float('inf')
min_diff = float('inf')
max_sum  = -float('inf')
min_sum  = float('inf')
for _ in range(n):
    x, y =map(int, input().split())
    max_diff = max(max_diff, x-y)
    min_diff = min(min_diff, x-y)
    max_sum = max(max_sum, x+y)
    min_sum  = min(min_sum, x+y)
print(max(max_diff - min_diff, max_sum - min_sum))
import sys
input=sys.stdin.readline

n=int(input())
a,b,c,d=-10**9,10**9,-10**9,10**9
for _ 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)
print(max(a-b,c-d))
N = int(input())
xy = [tuple(map(int, input().split())) for _ in range(N)]
xy.sort(reverse=True)

ans = 0
M = xy[0][0] + xy[0][1]
m = xy[0][0] - xy[0][1]
for x, y in xy[1:]:
    ans = max(ans, M-x-y, m-x+y)
    M = max(M, x+y)
    m = max(m, x-y)

print(ans)
import sys
input=sys.stdin.readline

def main():
    n=int(input())
    XY=[tuple(map(int,input().split())) for _ in range(n)]
    U,V=[],[]
    for x,y in XY:
        U.append(x+y)
        V.append(x-y)
    print(max(max(U)-min(U),max(V)-min(V)))
    
if __name__=='__main__':
    main()
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline

n = int(input())
INF = 1 << 35
M = -INF
m = INF
d0 = []
d1 = []
for i in range(n):
    x, y = map(int, input().split())
    a = x - y
    b = x + y
    d0.append(a)
    d1.append(b)
print(max(max(d0) - min(d0), max(d1) - min(d1)))
n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]
a = []
b = []
for i in range(n):
    a.append(xy[i][0]+xy[i][1])
    b.append(xy[i][0]-xy[i][1])
a_sort = sorted(a)
b_sort = sorted(b)

print(max(a_sort[-1]-a_sort[0],b_sort[-1]-b_sort[0]))
N = int(input())
a14=set([])
a23=set([])
for _ in range(N):
	x,y=map(int, input().split())
	a14.add(x+y)
	a23.add(x-y)


b14=max(a14)-min(a14)
b23=max(a23)-min(a23)

print(max(b14,b23))



# 2darray [[0] * 4 for i in range(3)]
# import itertools
n = int(input())
mi0,ma0 = 10**9,-(10**9)
mi1,ma1 = 10**9,-(10**9)
for i in range(n):
    a,b = map(int, input().split())
    c,d = a-b,a+b
    if c < mi0:
        mi0 = c
    if c > ma0:
        ma0 = c
    if d < mi1:
        mi1 = d
    if d > ma1:
        ma1 = d
print(max(ma0-mi0,ma1-mi1))
N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]

ans = 0

def measure(originX,originY):
    dist = []
    for X,Y in XY:
        dist.append(abs(X-originX)+abs(Y-originY))
    return max(dist)-min(dist)

originX = 0
originY = 0
ans = max(ans,measure(originX,originY))

originX = 10**9
originY = 0
ans = max(ans,measure(originX,originY))

originX = 0
originY = 10**9
ans = max(ans,measure(originX,originY))

originX = 10**9
originY = 10**9
ans = max(ans,measure(originX,originY))

print(ans)
N = int(input())
X = [[] for _ in range(N)]
z = [0 for _ in range(N)]
w = [0 for _ in range(N)]
for i in range(N):
    X[i] = list(map(int, input().split()))
    z[i] = X[i][0] +X[i][1]
    w[i] = X[i][0] -X[i][1]

ans = max(max(z)-min(z), max(w)-min(w))
print(ans)
n=int(input())
ma=2
mi=10**9+7
mu=2
me=10**10
for i in range(n):
    x,y=map(int,input().split())
    l=x+y
    s=-x+10**9+1+y
    ma=max(ma,l)
    mi=min(mi,l)
    mu=max(mu,s)
    me=min(me,s)
print(max(ma-mi,mu-me))
l=[list(map(int,input().split())) for _ in range(int(input()))]
f=sorted([x+y for x,y in l])
g=sorted([x-y for x,y in l])
print(max(f[-1]-f[0],g[-1]-g[0]))