peterverebics/CodeNet_Python_118 huggingface dataset:
n=input()
maxa=-1
mina=10000000000
maxb=-1
minb=10000000000

for i in range(int(n)):
    x,y=map(int,input().split())
    maxa=max(maxa,x+y)
    mina=min(mina,x+y)
    maxb=max(maxb,x-y)
    minb=min(minb,x-y)

print(max(abs(maxa-mina),abs(maxb-minb)))
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(la[0][1]-la[-1][1])
          )
      )
from sys import stdin

readline = stdin.readline

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

xy.sort()

c = set(xy[:1000])
c = c | set(xy[-1000:])

xy.sort(key=lambda x: x[1])

c = c | set(xy[:1000])
c = c | set(xy[-1000:])

c = list(c)
result = 0
for i in range(len(c)):
    for j in range(i + 1, len(c)):
        result = max(result, abs(c[i][0] - c[j][0]) + abs(c[i][1] - c[j][1]))
print(result)
n = int(input())
x = []
for i in range(n):
    a = list(map(int,input().split()))
    x.append(a)
c_1 = sorted(x, key=lambda x:x[1],reverse = True)
c_2= sorted(x, key=lambda x:x[0],reverse = True)
ans_1 = abs(abs(c_1[0][0]) - abs(c_1[-1][0])) + abs(abs(c_1[0][1]) - abs(c_1[-1][1]))
ans_2 = abs(abs(c_2[0][0]) - abs(c_2[-1][0])) + abs(abs(c_2[0][1]) - abs(c_2[-1][1]))

print(max(ans_1,ans_2))
n = int(input())
lst = []
for _ in range(n):
    a, b = map(int, input().split())
    lst.append((a,b))

lst.sort(key=lambda x: x[0]+x[1])
print(abs(lst[-1][0]-lst[0][0])+abs(lst[-1][1]-lst[0][1]))
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

x0 = 10 ** 9
y0 = 10 ** 9

d = x0 + y0

M = 0
m = 4 * d + 1
for x, y in XY:
    p = x + y + d
    if p > M:
        M = p
    if p < m:
        m = p

# print(M, m)

print(M - m)
n = int(input())

max1 = 0
min1 = 10 ** 10
max0 = 0
min0 = 10 ** 10

for i in range(n):
    x,y = list(map(int,input().split()))
    k0 = x - y
    k1 = x + y
    if k0 > max0:
        max0 = k0
    if k0 < min0:
        min0 = k0
    if k1 > max1:
        max1 = k1
    if k1 < min1:
        min1 = k1


ans = max(max1-min1,max0-min0)

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

def f(x,y):
    return (x-y, x+y)
d=[]
x1, y1 = f(*list(map(int, input().split())))
for _ in range(N-1):
    x, y = f(*list(map(int, input().split())))
    d.append(max(abs(x-x1),abs(y-y1)))
print(max(d))
def f(n, m):
  return(abs(n[0]-m[0]) + abs(n[1]-m[1]))

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

XY.sort(key=lambda i: i[0])
p1 = XY[0]
p2 = XY[-1]
XY.sort(key=lambda i: i[1])
p3 = XY[0]
p4 = XY[-1]

ans = max(f(p1,p2),f(p1,p3),f(p1,p4),f(p2,p3),f(p2,p4),f(p3,p4))
print(ans)
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):
    x,y=r[i]
    a=max(a,x+y)
    c=min(c,x+y)
    b=max(b,x-y)
    d=min(d,x-y)
print(abs(max(a-c,b-d)))
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

n = int(input())
points = set()
for _ in xrange(n):
    x,y = (int(x) for x in input().split())
    points.add((x,y))

if len(points) <= 1:
    print(0)
else:
    srt = sorted(points, key=lambda x: x[0] + x[1])
    print(max(srt[0] + srt[-1]))
n = int(input())

x = []
y = []
distance = []


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

for i in range(len(x)):
  for j in range(i+1,len(x)):
    temp = abs(x[i] - x[j]) + abs(y[i] - y[j])
    distance.append(temp)

max = 0

for i in range(len(distance)-1):
  if distance[i] > distance[i+1]:
    max = distance[i]

print(max)
# # input here
# _INPUT = """\

# """

import numpy as np
from scipy.spatial import distance
def main():
    n = int(input())
    lis = []
    for i in range(n):
        x,y = map(int, input().split())
        lis.append([x,y])
    M = np.array(lis)
    try:
        dist_M = distance.cdist(M, M, metric='cityblock')
        print(str(np.max(dist_M)).split('.')[0])
    except:
        print(0)
if __name__ == '__main__':
    # import io
    # import sys
    # sys.stdin = io.StringIO(_INPUT)
    main()
import itertools

n = int(input())
ps = list({
    tuple(map(int, input().split()))
    for _ in range(n)
})

g0 = sum([p[0] for p in ps]) / len(ps)
g1 = sum([p[1] for p in ps]) / len(ps)

maxd = 0
maxp = ps[0]
for p in ps:
    d = abs(g0 - p[0]) + abs(g1 - p[1])
    if d > maxd:
        maxp = p
        maxd = d

maxd = 0
for p in ps:
    maxd = max(maxd, abs(maxp[0] - p[0]) + abs(maxp[1] - p[1]))
print(maxd)
n = int(input())
xy = []

for i in range(n):
    x,y = map(int, input().split())
    tmp = x + y
    if i == 0:
      tmp_max = tmp
      tmp_min = tmp
    else:
      if tmp > tmp_max:
        tmp_max = tmp
      if tmp < tmp_min:
        tmp_min = tmp
ans = tmp_max - tmp_min
print(ans)
t=int(input())
z=[]
for i in range(t):
      a,b=map(int,input().split())
      z.append([a,b])
i=0
j=i+1
k=[0]
while(i<len(z) and j<len(z)):
      p=(z[i])[0]
      q=(z[j])[0]
      r=(z[i])[1]
      s=(z[j])[1]
      k.append(abs(q-p)+abs(s-r))
      i=i+1
      j=j+1
print(max(k))
n = int(input())
mi= 10**10
ma = -10**10
for i in range(n):
  a,b = map(int,input().split())
  mi = min(mi,a+b)
  ma = max(ma,a+b)
print(abs(mi-ma))
n = int(input())
p = []
for i in range(n):
  x, y = map(int, input().split())
  p.append([x, y])
  
p.sort(key=lambda x: (x[0]**2 + x[1]**2))

print(p[n-1][0] - p[0][0] + p[n-1][1] - p[0][1])
num_inputs = int(input())
pairs = []
for i in range(0, num_inputs):
  pair = input().split(" ")
  curr_x = int(pair[0])
  curr_y = int(pair[1])
  pairs.append(curr_x + curr_y)

print(max(pairs) - min(pairs))
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N = I()
A,B = [],[]  # x+y,x-y たちのリスト
for i in range(N):
    x,y = MI()
    A.append(x+y)
    B.append(x-y)

print(max(A)-min(A),max(B)-min(B))
n=int(input())
x=[]
y=[]
s=[]
for i in range(n):
    xi,yi=map(int,input().split())
    x.append(xi)
    y.append(yi)
    s.append(xi+yi)
mini=s.index(min(s))
maxi=s.index(max(s))
absx=abs(x[mini]-x[maxi])
absy=abs(y[mini]-y[maxi])
print(absx+absy)
N = int(input())
min_dist_o = 10**10
max_dist_o = 0
min_dist_edge = 10**10
max_dist_edge = 0
for i in range(N):
    x,y = map(int,input().split())
    dist_o = x+y
    dist_edge = 10**9+1-x+y
    if dist_o > max_dist_o:
        max_dist_o=dist_o
    if dist_o < min_dist_o:
        min_dist_o=dist_o
    if dist_edge > max_dist_edge:
        max_dist_edge=dist_edge
    if dist_o < min_dist_o:
        min_dist_edge=dist_edge
print(max(max_dist_o-min_dist_o,max_dist_edge-min_dist_edge))
n = int(input())

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

for i in range(n-1):
    a, b = map(int, input().split())
    
    mini = min(a+b, mini)
    maxi = max(a+b, maxi)
    
print(abs(maxi-mini))
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

    mat = []
    a = []
    b = []

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

    d1 = max(a) - min(a)
    d2 = max(b) - min(b)

    print(max(d1,d2))


if __name__ == '__main__':
    main()
N = int(input())
lst = []
for i in range(N):
  a = tuple(map(int,input().split()))
  lst.append(a)

lst = sorted(lst)
minx, miny = lst[0]
maxx, maxy = lst[0]
maxdist = 0
for i in range(N-1):
  x,y = lst[i+1]
  dist1 = abs(minx - x) + abs(miny - y)
  dist2 = abs(maxx - x) + abs(maxy - y)
  if dist1 > maxdist:
    maxx = x
    maxy = y
    maxdist = dist1
  elif dist2 > maxdist:
    minx = x
    miny = y
    maxdist = dist2
    
print(maxdist)
n = int(input())
r = [0,0]
l = [10**9+1,10**9+1]
for _ in range(n):
    a, b = map(int, input().split())
    if a >= r[0] and b >= r[1]:
        r = [a, b]
    if a <= l[0] and b <= l[1]:
        l = [a, b]

res = abs(r[0]-l[0])+abs(r[1]-l[1])
print(res)
N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]
for i in range(N):
    x, y = XY[i][0], XY[i][1]
    XY[i][0] = x-y
    XY[i][1] = x+y

ans = 0
for i in range(2):
    tmp_1 = 0
    tmp_2 = float("inf")
    for j in range(N):
        tmp_1 = max(tmp_1, XY[j][i])
        tmp_2 = min(tmp_2, XY[j][i])
    ans = max(ans, tmp_1-tmp_2)
print(ans)
n = int(input())
maxx1 =maxx2 =0
minn1 = minn2 =  2000000001
for i in range(n):
    x,y = map(int,input().split())
    minn1 = min(minn1,x+y)
    maxx1 = max(maxx1,x+y)
    minn2 = min(minn2,x-y)
    maxx2 = max(maxx2,x-y)
print(max(maxx1-minn1,maxx2-minn2))
import sys
input=sys.stdin.readline
n=int(input())
ab=[]
A=0
B=0
C=1e18
D=1e18
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))
beforex=0
beforey=0
sum=0
for i in range(int(input())):
  xy=list(map(int,input().split()))
  if i == 0:
    beforex=xy[0]
    beforey=xy[1]
  sum=max(sum,abs(beforex-xy[0])+abs(beforey-xy[1]))
  beforex=xy[0]
  beforey=xy[1]

print(sum)
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):
    x,y=r[i]
    a=max(a,x+y)
    c=min(c,x+y)
    b=max(b,x-y)
    d=min(d,x-y)
print(max(a-c,b-d))
N = int(input())
def f0(x,y):
    return x-y

def f1(x,y):
    return x+y



max0 = 0
max1 = 0
min0 = 10**10
min1 = 10**10

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

    a = f0(x,y)
    b = f1(x,y)

    max0 = max(a, max0)
    min0 = min(a, min0)
    max1 = max(b, max1)
    min1 = min(b, min1)


print(max(max0-min0, max1-min1))
N=int(input())
D=[]
for i in range(N):
  x,y=map(int, input().split())
  D.append((x,y))
D=sorted(D)
a,b=D[0],D[-1]
D=sorted(D,reverse=True, key=lambda x: x[1])
c,d=D[0],D[-1]
F=[a,b,c,d]
ans=0
for i in range(4):
  for j in range(4):
    f=abs(F[i][0]-F[j][0])+abs(F[i][1]-F[j][1])
    ans=max(ans,f)
print(ans)
N=int(input())

listA=[]

while True:
    try:
      a,b=map(int, input().split())
      listA.append(a+b)

    except:
        break;

print(max(listA)-min(listA))
N = int(input())
Y_MAX = 0
Y_MIN = 1000000000000

for i in range(N):
    x, y = map(int, input().split())
    if abs(0 - x) + abs(y - 1000000000000) > Y_MAX:
        Y_MAX = abs(0 - x) + abs(y - 1000000000000)
    if abs(0 - x) + abs(y - 1000000000000) < Y_MIN:
        Y_MIN = abs(0 - x) + abs(y - 1000000000000)
  
print(Y_MAX - Y_MIN)
n = int(input())
plus_max = 0
plus_min = 10**10
minus_max = 0
minus_min = 10**10
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())
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)
Z = max(Xmax - Xmin, Ymax - Ymin)
print(Z)
n = int(input())

xmax = 0
xmin = 2*10**9
ymax = 0
ymin = 2*10**9

for i in range(n):
    x, y = map(int, input().split())
    refx = x + y
    refy = x - y
    xmax = max(xmax, refx)
    xmin = min(xmin, refx)
    ymax = max(ymax, refy)
    ymin = min(ymin, refy)

ans = max(xmax - xmin, ymax - ymin)
print(ans)
def main():
    N = int(input())
    pts = []
    m = 0
    a1 = 0
    a2 = 0
    b1 = 0
    b2 = 0
    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()
N = int(input())
xs = []
ys = []

for _ in range(N):
    x, y = list(map(int, input().split(" ")))
    xs.append(x)
    ys.append(y)

max_dist = 0

for i in range(N):
    for j in range(i + 1, N):
        dist = abs(xs[i] - xs[j]) + abs(ys[i] - ys[j])
    if dist > max_dist:
        max_dist = dist

print(max_dist)
N = int(input())
hw = [[int(i) for i in input().split()] for _ in range(N)]

minD = 10**9
min = 0
maxD = 0
max = 0

for i in range(N):
    if (minD > (hw[i][0] + hw[i][1])):
        minD = hw[i][0] + hw[i][1]
        min = i
    if (maxD < hw[i][0] + hw[i][1]):
        maxD = hw[i][0] + hw[i][1]
        max = i

print(abs(hw[max][0] - hw[min][0]) + abs(hw[max][1] - hw[min][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)]

O = XY[0]
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

print(dist(O, S))
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline

n = int(input())
INF = 1 << 35
M = -INF
m = INF

for i in range(n):
    x, y = map(int, input().split())
    a = x - y
    b = x + y
    if a > b:
        a, b = b, a
    M = max(M, b)
    m = min(m, b)
print(M - m)
import sys

readline = sys.stdin.readline
N = int(readline())
A = []
B = []
for _ in range(N):
    x, y = map(int, readline().split())
    A.append(abs(x-y))
    B.append(abs(x+y))
print(max(max(A) - min(A), max(B) - min(B)))
N = int(input())
x = []
y = []
for i in range(N):
    x_s,y_s = map(int, input().split())
    x.append(x_s)
    y.append(y_s)

xmax = x.index(max(x))
xmin = x.index((min(x)))
ans1 = abs(max(x)-min(x))+abs(y[xmax] - y[xmin])

ymax = y.index(max(y))
ymin = y.index(min(y))
ans2 = abs(max(y)-min(y)) + abs(x[ymax]-x[ymin])
print(max(ans1,ans2))
N = int(input())

P = [[int(_) for _ in input().split()] for n in range(N)]

X = []
Y = []
for x, y in P:
    X.append(x)
    Y.append(y)
mx = (min(X) + max(X)) // 2
my = (min(X) + max(X)) // 2

Q = []
for x, y in P:
    x, y = x-mx, y-my
    Q.append((x+y, x-y))

ans = 0
for x, y in Q:
    ans = max(ans, abs(x) + abs(y))
print(ans)
import numpy as np
N = int(input())
max_z = 0
min_z = np.inf
max_w = 0
min_w = np.inf
for _ in range(N):
    x, y = map(int, input().split())
    z = x + y
    w = abs(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))
N=int(input())
A=[list(map(int, input().split()))  for _ in range(N)]
maxd=0
for i in range(N-1):
    for j in range(i,N-1):
        maxd=max(maxd,abs(A[i][0]-A[j][0])+abs(A[i][1]-A[j][1]))

print(maxd)
def main():
    n = int(input())
    d = [sum(map(int, input().split())) for _ in range(n)]
    d.sort()
    print(d[-1] - d[0])


if __name__ == '__main__':
    main()
x = input()

max = 0
min = 99999

for _ in range(int(x)):
 a = input()
 ax = int(a.split()[0])
 ay = int(a.split()[1])
# l = (ax*ax + ay*ay)**0.5
 l = (ax*1 + ay*1)**1
# print(l)
 if l > max: 
  max = l
 if l < min:
  min = l

# a<x<b, c<y<d
# manhatan = max - min
#print("manha")
print( max - min)

# bd, ac, ad, bc
import sys
N=int(sys.stdin.readline().strip())
XY=[ map(int, sys.stdin.readline().split()) for _ in range(N) ]
XY.sort(key=lambda x:(x[0],x[1]) )
a1=abs(XY[0][0]-XY[-1][0])+abs(XY[0][1]-XY[-1][1])
XY.sort(key=lambda x:(x[1],x[0]) )
a2=abs(XY[0][0]-XY[-1][0])+abs(XY[0][1]-XY[-1][1])
print max(a1,a2)
N = int(input())
m = 2*(10**9)+1
M = 0
for i in range(N):
  a,b = map(int,input().split())
  temp = a+b
  m = min(m,temp)
  M = max(M,temp)
print(M-m)
n=int(input())
l=[]
ar=[]
for i in range(n):
  l.append(list(map(int,input().split())))
  ar.append(l[-1][0]+l[-1][1])
ar.sort()
an=abs(ar[-1]-ar[0])
print(an)
N=int(input())

mmax=None
mmin=(0,0,0)
for i in range(N):
    x,y = map(int, input().split())
    if not mmax:
        mmax=(x,y,x+y)
        mmin=(x,y,x+y)
        continue
    if x+y > mmax[2]:
        mmax=(x,y,x+y)
    elif x+y < mmin[2]:
        mmin=(x,y,x+y)

print(mmax[2]-mmin[2])
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(th - x + y, left_up_max)
    right_down_min = min(th - x + y, right_down_min)

ans = max(right_up_max - left_down_min, left_up_max - right_down_min)
print(ans)
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
kyori = []
for i in range(N):
    tmp = xy[i][0] + xy[i][1]
    kyori.append((i, tmp))

kyori.sort(key=lambda x: x[1])
print(kyori[-1][1] - kyori[0][1])
N = int(input())
z = []
zz = []
for _ in range(N):
    x, y = map(int, input().split())
    zz.append(x-y)
    z.append(x+y)
z.sort()
zz.sort()
ans = z[-1]-z[0]
ans = max(ans, zz[-1]+zz[0])

print(ans)
curr_x = 0
curr_y = 0
num_inputs = int(input())
first_inputs = input().split(" ")
max_x = int(first_inputs[0])
max_y = int(first_inputs[1])
max_dist = 0
curr_dist = 0
for i in range(0, num_inputs - 1):
  pair = input().split(" ")
  curr_x = int(pair[0])
  curr_y = int(pair[1])
  curr_dist = abs(max_x - curr_x) + abs(max_y - curr_y)
  if curr_dist > max_dist:
    max_x = curr_x
    max_y = curr_y
    max_dist = curr_dist

print(max_dist)
n = int(input())
min_dis = 10 ** 10
max_dis = 0
for i in range(n):
    x, y = map(int, input().split())
    tmp1 = x + y
    min_dis = min(tmp1, min_dis)
    max_dis = max(tmp1, max_dis)

print(abs(max_dis - min_dis))
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((alfa-i) + (beta-j))
    ans = max(ans,max(man) - min(man))
    
print(ans)
num = int(input())
ll = []
x_test = []
y_test = []
xx = []
yy = []
val = []
for i in range(num):
    x,y = list(map(int,input().split()))
    ll.append([x,y])
for j in ll:
    x_test.append(j[0])
for k in ll:
    y_test.append(k[1])
for m in range(len(x_test)-1):
    test = abs(x_test[m]-x_test[m+1])
    xx.append(test)
for n in range(len(y_test)-1):
    tests = abs(y_test[n] - y_test[n + 1])
    yy.append(tests)
for o in range(len(xx)):
    vals = xx[o] + yy[o]
    val.append(vals)
print(max(val))
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

n = ii()
l = []
for i in range(n):
    l += [li()]

p, q, r, s = [0,0,1000000000,1000000000]
for x in l:
    p = max(p, x[0] + x[1])
    q = max(q, x[0] - x[1])
    r = min(r, x[0] + x[1])
    s = min(s, x[0] - x[1])

print(max(abs(p-r), abs(q-s)))
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 = 0
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)
N = int(input())
K = []
for i in range(N):
    x, y = map(int,input().split())
    t = x + y
    if x <= 0:
        t -= 4*abs(x)
    if y <= 0:
        t -= 4*abs(y)
    K.append([t, x, y])

K.sort()
A = [K[0][0]]
ans = K[-1][0] - K[0][0]
for i in range(N-1):
    if K[i][0] == K[i+1][0]:
        A.append(K[i+1][1])
    else:
        ans = max(ans, max(A) - min(A))
        A = [K[i][1]]
print(ans)
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
xy=sorted(xy, key=lambda x:x[0])
x1,y1=xy[0]
xn,yn=xy[-1]
ans=abs(x1-xn)+abs(y1-yn)
xy=sorted(xy,key=lambda x:x[1])
x1,y1=xy[0]
xn,yn=xy[-1]
ans2=abs(x1-xn)+abs(y1-yn)
print(max(ans,ans2))
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
yx = [[y, x] for x, y in xy]
xy.sort()
yx.sort()

ans = 0
tmp = [xy[0], xy[-1], yx[0], yx[-1]]
for x, y in tmp:
    for x1, y1 in tmp:
        ans = max(ans, abs(x - x1) + abs(y - y1))
print(ans)
N=int(input())
x=[list(map(int,input().split())) for _ in range(N)]

X=[]
for i in range(N):
    X.append(x[i][0]+x[i][1])
X.sort()
print(X[-1]-X[0])
N = int(input())
Point = [list(map(int, input().split())) for _ in range(N)]

minS = float("INF")
maxS = -1
for i in range(N):
    x, y = Point[i][0], Point[i][1]
    if x+y < minS:
        minS = x+y
        minI = i
    if x+y > maxS:
        maxS = x+y
        maxI = i

ans = abs(Point[maxI][0] - Point[minI][0]) + abs(Point[maxI][1] - Point[minI][1])
print(ans)
n=int(input())
s,p=10**10,10**10
t,q=0,0

for i in range(n):
  x,y=map(int,input().split())
  s=min(s,x+y)
  t=max(t,x+y)
  p=min(p,max(x-y,y-x))
  q=max(q,max(x-y,y-x))
  
print(max(t-s,q-p))
def mh(p1, p2):
  return abs(p2[0] - p1[0]) + abs(p2[1] - p1[1])

N = int(input())
points = set()
for i in range(N):
  x, y = [int(i) for i in input().split()]
  points.add(tuple([x, y]))

points_x = sorted(points, key=lambda x: x[0])
points_y = sorted(points_x, key=lambda x: x[1])


max_x = points_x[-1]
max_y = points_y[-1]
min_x = points_x[0]
min_y = points_y[0]

l = []
l.append(mh(max_x, min_x))
l.append(mh(max_y, min_y))
print(max(l))
import bisect
N = int(input())
X = []
Y = []
for _ in range(N):
    x,y = map(int,input().split())
    X.append(x)
    Y.append(y)

sumxy = [x+y for x,y in zip(X,Y)]
maxidx = sumxy.index(max(sumxy))
minidx = sumxy.index(min(sumxy))

ans = abs(X[maxidx] - X[minidx]) + abs(Y[maxidx] - Y[minidx])
print(ans)
n=int(input())
k=[]
s=[]
f=[]
for _ in range(n):
    x,y=map(int,input().split())
    k.append(x+y)
    s.append(x)
    f.append(y)


p=k.index(max(k))
q=k.index(min(k))
print((abs(s[p]-s[q]))+(abs(f[p]-f[q])))
n = int(input())


mi, ma = 1000000, 0
for i in range(n):
    x, y = map(int, input().split())
    x, y = abs(x), abs(y)
    mi = min(mi, x + y)
    ma = max(ma, x + y)

print(ma - mi)
N=int(input())
minz=10**11
minw=10**11
maxz=0
maxw=0
for i in range(N):
 
    a,b=map(int,input().split())
    if  a+b>maxz:
        maxz=a+b

    if a+b<minz:
        minz=a+b

    if  abs(a-b)>maxw:
        maxw=abs(a-b)

    if abs(a-b)<minw:
        minw=abs(a-b)

    
 
print(max((maxz-minz),(maxw-minw)))
import math
n=int(input())
a,b=0,0
minp,maxp=0,0
k,j=0,0
for i in range(n):
    x,y=map(int,input().split())
    a=x+y
    b=math.fabs(x-y)
    maxp=max(maxp,a)
    if i==0:
        minp=a
    else:
        minp=min(minp,a)
    j=max(math.fabs(x-y),k)
    k=math.fabs(x-y)
print(int(max(j+k,-minp+maxp)))
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:tuple(map(int,stdin.readline().split()))

n=int(input())

l=tuple([lnii() for i in range(n)])

if len(l)==1:
  print(0)
  exit()

x_max=0
x_min=10**10
y_max=0
y_min=10**10

for x,y in l:
  s=x-y
  x_max=max(x_max,s)
  x_min=min(x_min,s)

  t=x+y
  y_max=max(y_max,t)
  y_min=min(y_min,t)

x_ans=x_max-x_min
y_ans=y_max-y_min
print(max(x_ans,y_ans))
n=int(input())
z_max,z_min=0,10**10
w_max,w_min=0,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, y = map(int,input().split())
min_x = x
max_x = x
min_y = y
max_y = y
L = x ** 2 + y ** 2
min_L = L
max_L = L
for i in range(N-1):
  x, y = map(int, input().split())
  L = x ** 2 + y ** 2
  if min_L > L:
    min_x = x
    min_y = y
    min_L = L
  elif max_L < L:
    max_x = x
    max_y = y
    max_L = L
ans = max_x - min_x + max_y - min_y
print(ans)