peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
xy = []
for _ in range(N):
    x, y = map(int, input().split())
    xy.append([x, y])

xy1 = sorted(xy, key=lambda x: x[0])
xy2 = sorted(xy, key=lambda x: x[1])
# print(xy1)
# print(xy2)
dist1 = abs(xy1[0][0] - xy1[-1][0]) + abs(xy1[0][1] - xy1[-1][1])
dist2 = abs(xy2[0][0] - xy2[-1][0]) + abs(xy2[0][1] - xy2[-1][1])
ans = max(dist1, dist2)
print(ans)
import random

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

S = set()
for i in range(N):
  S.add((x[i], y[i]))
S = list(S)

ans = 0
for i in range(6):
  o = random.randint(0, len(S)-1)
  m = 0
  mp = 0
  for i in range(N):
    d = abs(x[i]-S[o][0])+abs(y[i]-S[o][1])
    if d>m:
      m = d
      mp = i
  for i in range(N):
    ans = max(ans, abs(x[i]-x[mp])+abs(y[i]-y[mp]))
print(ans)
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, maxW, minW = -1, float("inf"), -1, float("inf")
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())
a= [list(map(int, input().split())) for i in range(n)]

a1=float('inf')
a2=0

for i in range(n):
    cnt=a[i][0]+a[i][1]
    a1=min(a1,cnt)
    a2=max(a2,cnt)

print(a2-a1)
N = int(input())
x = [] * N
y = [] * N
for i in range(N):
    a, b = list(map(int, input().split()))
    x.append(a)
    y.append(b)
d = 0
ma = x[0] + y[0]
ima = 0
mi = x[0] + y[0]
imi = 0
for i in range(N):
    if x[i] + y[i] < mi:
        mi = x[i] + y[i]
        imi = i
    if x[i] + y[i] > ma:
        ma = x[i] + y[i]
        ima = i
d = abs(x[ima] - x[imi]) + abs(y[ima] - y[imi])
print(d)
n = int(input())
x = [0 for _ in range(n)]
for i in range(n):
    x[i] = list(map(int, input().split()))
for i in x:
    i.append(abs(x[0][0]-i[0]) + abs(x[0][1]-i[1]))
x.sort(key = lambda s:s[2])
ans = 0
for j in range(n):
        ans = max(ans, abs(x[-1][0] - x[j][0]) + abs(x[-1][1] - x[j][1]))
print(ans)
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
dist = [None] * N
for i in range(N):
    dist[i] = abs(xy[i][0] - xy[0][0]) + abs(xy[i][1] - xy[0][1])

for j in range(100):
    s = dist.index(max(dist))
    for i in range(N):
        dist[i] = abs(xy[i][0] - xy[s][0]) + abs(xy[i][1] - xy[s][1])
print(max(dist))
n = int(input())
max_t = -float('inf')
min_t = float('inf')
dic_p_x = {}
for _ in range(n):
  x, y = map(int, input().split())
  c = x + y
  if c > max_t:
    max_t = c
  if c < min_t:
    min_t = c
  if c not in dic_p_x:
    dic_p_x[c] = []
  dic_p_x[c].append(x)
max_d = max_t - min_t
for lst in dic_p_x.values():
  a, b = max(lst), min(lst)
  dis = 2 * (a - b)
  max_d = max(max_d, dis)
print(max_d)
N=int(input())
minab=10**11
maxab=0
mina=10**11
minb=10**11
maxa=0
maxb=0
for i in range(N):

    a,b=map(int,input().split())
    if  a+b>maxab:
        maxab=a+b
        maxa=a
        maxb=b
    if a+b<minab:
        minab=a+b
        mina=a
        minb=b
    

print(abs(maxa-mina)+abs(maxb-minb))
N=int(input())
t=10**9
k=0
for i in range(N):
    a,b=map(int,input().split())
    t=min(t,a+b)
    k=max(k,a+b)
print(k-t)
from copy import copy

N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]
for i in range(N):
    x, y = copy(XY[i][0]), copy(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())
p = set()
for _ in range(N):
    x, y = map(int, input().split())
    if (x, y) not in p:
        p.add((x, y))
p = [x + y for x, y in p]
p.sort()
print(abs(p[0] - p[-1]))
n=int(input())
x=[0]*n
y=[0]*n
z=[0]*n
a=-1
b=-1
for i in range(n):
    x[i],y[i] = list(map(int, input().strip().split()))
for i in range(n):
    z[i]=x[i]**2+y[i]**2
s=max(z)
t=min(z)
for i in range(n):
    if z[i]==s:
        a=i
        
    if z[i]==t:
        b=i
        
print(abs(x[a]-x[b])+abs(y[a]-y[b]))
N = int(input())

XY_max = -10**10
XY_min = 10**10
YX_max = -10**10
YX_min = 10**10

for _ in range(N):
  x,y = map(int, input().split())
  XY_max = max(XY_max,x+y)
  XY_min = min(XY_min,x+y)
  YX_max = max(YX_max,x-y)
  YX_min = max(XY_max,x-y)

print(max(XY_max-XY_min,YX_max-YX_min))
N = int(input())

ma = -float("inf")
mi = float("inf")
for i in range(N):
    x,y = list(map(int,input().split()))
    ma = max(ma,x+y)
    mi = min(mi,x+y)
print(ma-mi)
N = int(input())
table = [[int(i) for i in input().split()] for N in range(N)]

a = 0
b = 10**9 * 2
c = 0
d = 10**9 * 2
for i in range(N):
    p = table[i][0]
    q = table[i][1]
    if a < p+q:
        a = p+q
    if b > p+q:
        b = p+q
    if c < abs(p-q):
        c = abs(p-q)
    if d > abs(p-q):
        d = abs(p-q)

print(max(a-b,c-d))
import numpy as np

n = int(input())

x = []
y = []
for i in range(n):
  l = list(map(int, input().split()))
  x.append(l[0])
  y.append(l[1])

x = np.array(x)
y = np.array(y)

xy0 = x + y
xy1 = x - y
print(int(max(max(xy0)-min(xy1),max(xy1)-min(xy0))/2))
n = int(input())
# 各点のy=xへの写像を考える
x = []
y = []
t = []
for i in range(n):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)
    t.append([xi+yi, i])
t.sort(key=lambda x:x[0])
#print(t)
min_idx = t[0][1]
max_idx = t[-1][1]
ans = abs(x[max_idx]-x[min_idx]) + abs(y[max_idx]-y[min_idx])
print(ans)
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

min_diff = 10**9
max_diff = 1
min_sum = 2 * 10**9
max_sum = 2

for x,y in XY:
    min_diff = min(x-y, min_diff)
    max_diff = max(x-y, max_diff)
    min_sum = min(x+y, min_sum)
    max_sum = max(x+y, max_sum)

print(max(max_sum-min_sum, max_diff-min_diff))
import numpy as np
from scipy.spatial import distance
def main():
    n = int(input())
    try:
        lis = []
        for i in range(n):
            x,y = map(int, input().split())
            lis.append([x,y])
        M = np.array(lis)
        dist_M = distance.cdist(M, M, metric='cityblock')
        print(int(np.max(dist_M)))
    except:
        print(0)
if __name__ == '__main__':
    main()
N = int(input())
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
z = []
for i in range(0,len(x)):
  z.append(x[i]+y[i])
max = max(z)
min = min(z)
print(max-min)
n = int(input())
# 各点のy=xへの写像を考える
x = []
y = []
t = []
for i in range(n):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)
    t.append([xi+yi, i])
t.sort(key=lambda x:x[0])
print(t)
min_idx = t[0][1]
max_idx = t[-1][1]
ans = abs(x[max_idx]-x[min_idx]) + abs(y[max_idx]-y[min_idx])
print(ans)
N = int(input())
l = [tuple(map(int, input().split())) for i in range(N)]
d=set()
for i, j in zip(list(range(N)),list(range(1,N))):
    d.add(abs(l[i][0]-l[j][0]) + abs(l[i][1]-l[j][1]))
print(max(d))
from sys import *
N = int(stdin.readline())
a = []

for i in range(N):
    tmp = list(map(int, stdin.readline().split()))
    a.append(tmp)
a.sort(key = lambda k: k[0]+k[1])
best = 0
for i in range(N-1):
    best = max(best, abs(a[i][0] - a[-1][0]) + abs(a[i][1] - a[-1][1]))

print(best)
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
maxx = -10 ** 10

result = [0]
for i in range(n):
  if maxx <= x[i]:
    for j in range(n):
      result.append(abs(x[i] - x[j]) + abs(y[i] - y[j]))
      maxx = x[i]
print(max(result))
n = int(input())
x,y = list(map(int,input().split()))
c = 0
for i in range(n-1):
    a,b = list(map(int,input().split()))
    c = max(abs(x-a)+abs(y-b),c)
    x,y = a,b
print(c)
#!/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 = 0, 0, 10**10, 10**10
    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)]
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
		if kyori > ans:
			ans = kyori
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)
    d=max(0,d)
print(abs(max(a-c,b-d)))
n=int(input())

def distant(d1,d2):
  return abs(d1[0]-d2[0])+abs(d1[1]-d2[1])

d0=tuple(map(int,input().split()))
d1=tuple(map(int,input().split()))
dist=distant(d0,d1)

for i in range(n-2):
  d=list(map(int,input().split()))
  tmp=distant(d0,d)
  if tmp>dist:
    d0=d
    dist=tmp
  tmp=distant(d1,d)
  if tmp>dist:
    d1=d
    dist=tmp
print(dist)
n=int(input())
m=0
t1,t2=map(int,input().split())
for i in range(n-1):
    x,y=map(int,input().split())
    xn=(x-t1)
    yn=(y-t2)
    
    if xn<0:
        xn=-xn
    
    if yn<0:
        yn=-yn
    
    l=xn+yn
    if l>=m:
        m=l
    t1=x
    t2=y
print(m)
def main():
    n = int(input())
    xy = [list(map(int, input().split())) for _ in [0]*n]
    z = [max(x+y, x-y) for x, y in xy]
    print(max(z)-min(z))


main()
import bisect

n = int(input())
xy = [tuple(map(int, input().split())) for i in range(n)]
xy.sort()
a = xy[0]
xy.sort(key=lambda x: -x[0])
b = xy[0]
xy.sort(key=lambda x: x[1])
c = xy[0]
xy.sort(key=lambda x: -x[1])
d = xy[0]

def man(a:tuple, b:tuple):
    return abs(a[0]-b[0])+abs(a[1]-b[1])

ans = 0
ans = max(ans, man(a, b))
ans = max(ans, man(a, c))
ans = max(ans, man(a, d))
ans = max(ans, man(b, c))
ans = max(ans, man(b, d))
ans = max(ans, man(d, d))
print(ans)
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
import math
ll=[]
for i in range(n):
    ll.append([l[i][0]+l[i][1],i])
ll.sort()
print(int(math.fabs(l[ll[0][1]][0]-l[ll[-1][1]][0])+math.fabs(l[ll[0][1]][1]-l[ll[-1][1]][1])))
N = int(input())
xy = [list(map(int,input().split())) for _ in range(N)]
ma = 0
mi = float('inf')
for x,y in xy:
  ma = max(ma,abs(x-y))
  mi = min(mi,abs(x-y))
ans = ma - mi

ma = 0
mi = float('inf')
for x,y in xy:
  ma = max(ma,x+y)
  mi = min(mi,x+y)

print(ans)
N=int(input())
t=10**9*2
k=0
for i in range(N):
    a,b=map(int,input().split())
    t=min(t,a+b)
    k=max(k,a+b)
print(k-t)
charo={}
for i in range(int(input())):
    x,y=list(map(int,input().split()))
    sum1=x+y
    charo[sum1]=[x,y]
min1=min(charo)
max1=max(charo)
a=charo[min1]
b=charo[max1]
print(abs(a[0]-b[0])+abs(a[1]-b[1]))
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
f0 = sorted([x+y for x, y in xy])
f1 = sorted([x-y for x, y in xy])
print(max(f0[-1]+f1[0], f0[0]+f1[-1]))
import numpy as np
from scipy.special import comb

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

p = np.array(p)

ans = 0
for _ in range(n):
  ans = max(ans,max((np.sum(p-p[0],axis=1))))
  p = np.delete(p,0,0)

print(ans)
count = 0
count2 = 0
count3 = []
count4 = []
for _ in range(int(input())):
  x, y = list(map(int, input().split()))
  count = max(count, abs(x + y))
  count2 = max(count2, abs(x - y))
  count3.append(abs(x + y))
  count4.append(abs(x - y))
z = min(count3)
zz = min(count4)
print(max(count-z, count2-zz))
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  a-b>maxw:
        maxw=a-b

    if a-b<minw:
        minw=a-b

    
 
print(max((maxz-minz),(maxw-minw)))
n = int(input())
xy = list(list(map(int,input().split())) for _ in range(n))
l = []
for i in range(n):
    l.append(abs(xy[i][0])+abs(xy[i][1]))
d = abs(xy[l.index(max(l))][0]-xy[l.index(min(l))][0])+abs(xy[l.index(max(l))][1]-xy[l.index(min(l))][1])
print(d)
n=int(input())
zmax=0
zmin=float("inf")
wmax=0
wmin=float("inf")

for i in range(n):
    a,b=map(int,input().split())
    zmax=max(zmax,a+b)
    zmin=min(zmin,a+b)
    wmax=max(wmax,a-b)
    wmin=min(wmin,a-b)
    
print(max(zmax-zmin,wmax-wmin))
from collections import deque
N = int(input())

AM, Am, BM, Bm = 0, 10**18, 0, 10**18
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())
matrix = []
for i in range(n):
  a=[]
  for j in range(1):
    k = input()
    a= [int(i) for i in k.split()]
    matrix.append(a)
mu = []
for i in range(n):
  for j in range (n):
    sum = abs(matrix[i][0]-matrix[j][0])+ abs(matrix[i][1]-matrix[j][0])
    mu.append(sum)
mu.sort()
print(mu[-1])
n = int(input())


mm = 10**12
mx = 0

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

    mm = min(mm, x+y)
    mx = max(mx, x+y)

print(mx-mm)
import numpy as np
N=int(input())
s_max,s_min=0,float('inf')
t_max,t_min=0,float('inf')
for i in range(N):
    a,b=map(int,input().split())
    
    s,t=a+b,a-b
    s_max,s_min=max(s_max,s),min(s_min,s)
    t_max,t_min=max(t_max,t),min(t_min,t)
    
print(max(s_max-s_min,t_max-t_min))
N = int(input())
XYs = [list(map(int, input().split())) for _ in range(N)]
XYs.sort()

prevX = None
minY = maxY = XYs[0][1]
ans = 0
for x, y in XYs:
    if prevX != x and prevX is not None:
        minY -= 1
        maxY += 1
    ans = max(ans, abs(minY-y), abs(maxY-y))
    minY = minY if minY < y else y
    maxY = maxY if maxY > y else y
    prevX = x
print(ans)
N=int(input())

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

for s in range(N):
    for t in range(N):
        d=abs(XY[s][0])-abs(XY[t][0])+abs(XY[s][1])-abs(XY[t][1])
        Md.append(d)

print(max(Md))
n = int(input())
x = [list(map(int,input().split())) for i in range(n)]
c = 0
d = 0
y = sorted(x)
z = []
for i in range(n):
    z.append([x[i][1],x[i][0]])
a = sorted(z)
for i in range(n-1):
    c = max(abs(y[i][0]-y[i+1][0])+abs(y[i][1]-y[i+1][1]),c)
    d = max(abs(a[i][0]-a[i+1][0])+abs(a[i][1]-a[i+1][1]),c)
print(max(c,d))
n=int(input())
xy=[list(map(int,input().split()))for _ in range(n)]
xy1ma=0
xy1mi=10**9
xy2ma=0
xy2mi=10**9
for x,y in xy:
  xy1ma=max(xy1ma,x-y)
  xy1mi=min(xy1mi,x-y)
  xy2ma=max(xy2ma,x+y)
  xy2mi=min(xy2mi,x+y)
print(max(xy1ma-xy1mi,xy2ma-xy2mi))
N = int(input())
i = []
j = []
for k in range(N):
    x, y = map(int, input().split())
    i.append(x+y)
    j.append(-x-y)

print(max(max(i)+max(j), abs(min(i)+min(j))))
#!/usr/bin/env python3


def maximize(ps):
    zs = sorted(x + y for x, y in ps)
    return abs(zs[0] - zs[-1])


def main():
    n = int(input())
    ps = []
    for _ in range(n):
        ps.append(tuple(int(z) for z in input().split()))
    res = maximize(ps)
    print(res)


if __name__ == '__main__':
    main()
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
xy.sort()
dist = [None] * N
for i in range(N):
    dist[i] = abs(xy[i][0] - xy[0][0]) + abs(xy[i][1] - xy[0][1])

s = dist.index(max(dist))
dist2 = [None] * N
for i in range(N):
    dist2[i] = abs(xy[i][0] - xy[s][0]) + abs(xy[i][1] - xy[s][1])
print(max(dist2))
n = int(input())
table = []
maxl,minl = [],[]
for _ in range(n):
  x,y = map(int,input().split())
  table.append([x,y])
xmax,xmin = max(table)[0],min(table)[0]
ymax,ymin = max(table,key=lambda x:x[1])[1],min(table,key=lambda x:x[1])[1]
for x,y in table:
  if x==xmax or y==ymax:
    maxl.append([x,y])
  if x==xmin or y==ymin:
    minl.append([x,y])
ans = 0
for x,y in maxl:
  for k,l in minl:
    ans = max(abs(x-k)+abs(y-k),ans)
print(ans)
def main():
    n = int(input())
    
    candidates = []
    for _ in range(n):
        x,y = tuple(map(int,input().split()))
        candidates.append(x+y)

    print(max(candidates)-min(candidates))

if __name__ == "__main__":
    main()
N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]
L.sort(key = lambda x: abs(x[0] + x[1]), reverse = True)

base_x = L[0][0] 
base_y = L[0][1]
ans = 0
for l in L:
    ans = max(ans, abs(l[0] - base_x) + abs(l[1] - base_y))

print(ans)
n = int(input())
x = [0]*n
y = [0]*n
max = 0
s = 0
for i in range(n):
	x[i],y[i] = map(int,input().split())
for j in range(n):
	if max < abs(x[0] - x[j]) + abs(y[0] - y[j]):
		max = abs(x[0] - x[j]) + abs(y[0] - y[j])
		s = j
for k in range(n):
	if max < abs(x[s] - x[j]) + abs(y[s] - y[j]):
		max = abs(x[s] - x[j]) + abs(y[s] - y[j])
print(max)
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
kyori = []
for i in range(N):
    tmp1 = xy[i][0] + xy[i][1]
    tmp2 = abs(xy[i][0] - xy[i][1])
    kyori.append((i, tmp1, tmp2))


kyori.sort(key=lambda x: (x[1], x[2]))
print(abs(xy[kyori[0][0]][0] - xy[kyori[-1][0]][0]) + abs(xy[kyori[0][0]][1] - xy[kyori[-1][0]][1]))
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

print(max(f) - min(f))
N = int(input())

XY_max = -10**10
XY_min = 10**10
YX_max = -10**10
YX_min = 10**10

for _ in range(N):
  x,y = map(int, input().split())
  XY_max = max(XY_max,x+y)
  XY_min = min(XY_min,x+y)
  YX_max = max(YX_max,x-y)
  YX_min = max(YX_min,x-y)

print(max(XY_max-XY_min,YX_max-YX_min))
n=int(input())
X=[]
Y=[]
for i in range(n):
  x,y=map(int,input().split())
  X.append(x+y)
  Y.append(x-y)
max_x=max(X)
min_x=min(X)
max_y=max(Y)
min_y=min(Y)
l=max(max_x-min_x,max_y-min_y)
P=[(min(X)+l//2,min(Y)+l//2),(min(X)+l//2,max(Y)-l//2),
  (max(X)-l//2,min(Y)+l//2),(max(X)-l//2,max(Y)-l//2)]
ans=0
print((max_x-min_y)//2)
n = int(input())
l=[]
for i in range(n):
  l.append(list(map(int,list(input().split()))))
l.sort()
c=0
print(l)
for i in range(n):
  t = abs(l[i][0]-l[0][0])+abs(l[i][1]-l[0][1])
  if t>c:
    c=t
print(c)
n=int(input())
minman=(10**9)*2
maxman=0
for i in range(n):
  x,y=map(int, input().split())
  ab=x+y
  if ab< minman:
    minman=ab
  if maxman<ab:
    maxman=ab
print(maxman-minman)
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[:750])
c = c | set(xy[-750:])

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

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

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())
l = []
for i in range(n):
    n,m = map(int,input().split())
    l.append(n+m)

print (max(l)-min(l))
n = int(input())

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

md = 0
for i in range(n-1):
    for j in range(i+1,n):
        d1 = abs(cd[i][0] - cd[j][0])
        d2 = abs(cd[i][1] - cd[j][1])
        md = max(d1, d2)

print(md)
from itertools import combinations

N = int(input())
p = []
for _ in range(N):
    x, y = map(int, input().split())
    p.append((x, y))
px = sorted(p, key=lambda i: i[0])
py = sorted(p, key=lambda i: i[1])
res = 0
for p1, p2 in combinations([px[0], px[-1], py[0], py[-1]], 2):
    res = max(res, abs(p1[0] - p2[0]) + abs(p1[1] - p2[1]))
print(res)
n = int(input())
maxsum = -float('inf')
minsum = float('inf')
maxdif = -float('inf')
mindif = float('inf')
for i in range(n):
  x, y = map(int, input().split())
  trysum = x + y
  trydif = x - y
  if trysum >= maxsum:
    maxsum = trysum
  if trysum <= minsum:
    minsum = trysum
  if trydif >= maxdif:
    maxdif = trydif
  if trydif <= minsum:
    mindif = trydif
print(max(maxsum - minsum, maxdif - mindif))
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(Y) + max(Y) // 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)
Row=int(input())
X=[]
Y=[]
for i in range(Row):
    n,a=input().split()
    X.append(int(n))
    Y.append(int(a))
A=[]
B=[]
for i in range(len(X)):
    A.append(X[i]-Y[i])
    B.append(X[i]+Y[i])
maxmax1=0
maxmax2=0
minmin1=10**10
minmin2=10**10
for i in range(len(A)):
    maxmax1=max(maxmax1,A[i])
    minmin1=min(minmin1,A[i])
for i in range(len(B)):
    maxmax2=max(maxmax2,B[i])
    minmin2=min(minmin2,B[i])
print(max((maxmax1-minmin1),(maxmax2-minmin2)))
n = int(input())
arr = []
for i in range(n):
  arr.append(tuple(map(int, input().split())))
arr.sort(key = sum)
mx = max(arr, key = sum)
mn = min(arr, key = sum)
print(abs(mx[0]-mn[0]) + abs(mx[1] - mn[0]))
n = int(input())
xy = list(list(map(int,input().split())) for _ in range(n))
l = []
for i in range(n):
    l.append(xy[i][0]+xy[i][1])
d = abs(abs(xy[l.index(max(l))][0])-abs(xy[l.index(min(l))][0]))+abs(abs(xy[l.index(max(l))][1])-abs(xy[l.index(min(l))][1]))
print(d)
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]

num=[i[0]+i[1] for i in l]

mi=num.index(min(num))
ma=num.index(max(num))
a=abs(l[ma][0]-l[mi][0])
b=abs(l[ma][1]-l[mi][1])

print(a+b)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
xy = [0] * n

xy_plus_max = 0
xy_plus_min = 10 ** 10
xy_minus_max = 0
xy_minus_min = 10 ** 10
for i in range(n):
    x, y = map(int, input().split())
    xy_plus_max = max(xy_plus_max, abs(x + y))
    xy_plus_min = min(xy_plus_min, abs(x + y))
    xy_minus_max = max(xy_minus_max, abs(x - y))
    xy_minus_min = min(xy_minus_min, abs(x - y))

print(max(xy_plus_max - xy_plus_min, xy_minus_max - xy_minus_min))
n = int(input())
s = []
for i in range(n):
    x = list(map(int, input().split()))
    s.append(x)
t = sorted(s)
u = sorted(s, key=lambda x: x[1])
res = 0

for X in [t[0], u[0], t[-1], u[-1], t[n // 2], u[n // 2], t[-1 + n // 2], u[-1 + n // 2]]:
    for Y in [t[0], u[0], t[-1], u[-1], t[n // 2], u[n // 2], t[-1 + n // 2], u[-1 + n // 2]]:
        tmp = abs(X[0] - Y[0]) + abs(X[1] - Y[1])
        res = max(res, tmp)
print(res)
n=int(input())
ans=[]
for i in range(n):
    x,y=map(int,input().split())
    ans.append(x+y)
ans=sorted(ans)
print(ans[-1]-ans[0])
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

result = []
for i in range(n - 1):
  for j in range(n - 1):
    result.append(abs(x[i] - x[j]) + abs(y[i] - y[j]))

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

xsort = sorted(xy,key=lambda x:x[0])
ysort = sorted(xy,key=lambda x:x[1])

ans = 0
for i in range(min(n,10**3)):
    for j in range(min(n,10**3)):
        ans = max(ans,abs(xsort[i][0]-xsort[-j][0])+abs(xsort[i][1]-xsort[-j][1]))
        ans = max(ans,abs(ysort[i][0]-ysort[-j][0])+abs(ysort[i][1]-ysort[-j][1]))
print(ans)
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:tuple(map(int,stdin.readline().split()))

n=int(input())

l=set(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

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

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


  ans=max(s,y)
print(ans)
n = int(input())
X = []
Y = []
for i in range(n):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)

maxXidx = X.index(max(X))
maxYidx = Y.index(max(Y))
minXidx = X.index(min(X))
minYidx = Y.index(min(Y))

ans = max(abs(X[maxXidx] - X[minXidx]) + abs(Y[maxXidx] - Y[minXidx]),abs(X[maxYidx] - X[minYidx]) + abs(Y[maxYidx] - Y[minYidx]))
print(ans)
import sys
input = sys.stdin.readline
n = int(input())
xy = tuple(map(int, input().split()))
pM = sum(xy)
pm = sum(xy)
mM = abs(xy[1] - xy[0])
mm = abs(xy[1] - xy[0])
for _ in range(n - 1):
    xy = tuple(map(int, input().split()))
    s = sum(xy)
    d = abs(xy[0] - xy[1])
    if s > pM:
        pM = s
    elif s < pm:
        pm = s
    if d > mM:
        mM = d
    elif d < mm:
        mm = d
print(max(abs(pM-pm), abs(mM-mm)))