peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import deque
def dist(A,B):
    return abs(A[0]-B[0])+abs(A[1]-B[1])

N=int(input())
P=[0]*N

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

I=0
M=-1
for i in range(N):
    if M<dist(P[0],P[i]):
        I=i
        M=dist(P[0],P[i])

J=0
M=-1
for j in range(N):
    if M<dist(P[I],P[j]):
        J=j
        M=dist(P[I],P[j])

print(dist(P[I],P[J]))
import sys
import itertools
# import numpy as np
import time
import math
from heapq import heappop, heappush
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import permutations
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N = int(input())
C = [0] * N
for i in range(N):
    x, y = map(int, input().split())
    C[i] = x + y
C = sorted(C)
print(abs(C[-1] - C[0]))
n = int(input())

manhat_list = []

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

print(max(manhat_list) - min(manhat_list))
N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]
L = [l[0]+l[1] for l in L]
L.sort()
print(L[-1]-L[0])
N = int(input())
memo = []
for i in range(N):
    x,y = map(int,input().split())
    memo.append(x+y)
memo.sort()

print(memo[-1]-memo[0])
n = int(input())
points = []
for i in range(n):
    a, b = map(int,input().split())
    points.append(a + b)

ans = max(points) - min(points)
print(ans)
n = int(input())
m = []
for _ in range(n):
  l = list(map(int,input().split()))
  m.append(l)
mx = float('-inf')
for i in range(n):
  for j in range(i+1,n):
    mx = max(mx,abs(m[i][0]+m[j][0])+abs(m[i][1]+m[i][1]))
print(mx)
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**12
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)))
pos = []
n = int(input())
for i in range(n):
    pos.append(list(map(int,input().split())))

pos.sort()

print(abs(pos[0][0]-pos[n-1][0])+abs(pos[0][1]-pos[n-1][1]))
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(p,q,r,s)
print(max(abs(p-r), abs(q-s)))
n = int (input())

xy = []

def dist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])
    
for i in range(n):
    x, y = map(int,input().split())
    xy.append([x, y])

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

print(dist(xy[0], xy[-1]))
def dist(i, j):
  return abs(i[0]-j[0])+ abs(i[1] - j[1])

N = int(input())

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

ans = 0
tmp = 0
ind1 = 0
ind2 = 0
for i in range(N):
  for j in range(N): 
    if dist((x[ind1], y[ind1]), (x[j], y[j])) >tmp:
      tmp = dist((x[ind1], y[ind1]), (x[j], y[j])) 
      ind2 = j
  if ans == tmp:
    break
  else:
    ans = tmp
    ind1 = ind2
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)]))

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())
point_sum = []
for i in range(n):
  a,b = map(int, input().split())
  point_sum.append(max(a+b,a-b,b-a))
print(max(point_sum) - min(point_sum))
N = int(input())

x = [list(map(int, input().split())) for i in range(N)]
ma = x[0][0] * x[0][1] / 2
mai = 0
mii = 0
mi = x[0][0] * x[0][1] / 2
for i in range(1,N):
    a = x[i][0] * x[i][1] / 2
    if ma < a:
        ma = a
        mai = i
    elif mi > a:
        mi = a
        mii = i
print(abs(x[mii][0]-x[mai][0])+abs(x[mii][1]-x[mai][1]))
(n,),*e=[[*map(int,i.split())]for i in open(0)]
a=sorted(e)
b=sorted(e,key=lambda x: x[1])
c=a[:10]+a[:10]+b[10:]+b[:10]
ans=0
for i,j in c:
    for ii,jj in c:
        ans=max(ans,abs(i-ii)+abs(j-jj))
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(b1, y - x)
        N = N - 1
    print(max(a1 - a2, b1 - b2))

main()
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())

z_max=0
z_min=10**10
w_max=0
w_min=10**10

for i in range(n):
  x,y=nii()
  z=x-y
  z_max=max(z_max,z)
  z_min=min(z_min,z)

  w=x+y
  w_max=max(w_max,w)
  w_min=min(w_min,w)

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

ans=0
i=0
for i in range(n-1):
    j=i+1
    while j<n:
        m=abs(data[i][0]-data[j][0])+abs(data[i][0]-data[j][0])
        ans=max(ans,m)
        j+=1

print(ans)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())

XY = []
for _ in range(N):
    x, y = mapint()
    XY.append((x, y))

sx, sy = XY[0]
tmp = -1
for nx, ny in XY[1:]:
    if abs(sx-nx)+abs(sy-ny)>tmp:
        tmp = abs(sx-nx)+abs(sy-ny)
        ex, ey = nx, ny

ans = -1
for nx, ny in XY:
    if abs(ex-nx)+abs(ey-ny)>ans:
        ans = abs(ex-nx)+abs(ey-ny)

print(ans)
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)

print(distance)
max = distance[0]
 
for i in range(1,len(distance)-1):
  if distance[i] >= max:
    max = distance[i]
 
print(max)
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
print (ima, imi)
d = abs(x[ima] - x[imi]) + abs(y[ima] - y[imi])
print(d)
N = int(input())
List = set([])
x,y = map(int,input().split())
for i in range(N-1):
    x1,y1 = map(int,input().split())
    List.add(abs(x-x1)+abs(y-y1))
    x,y= x1,y1
print(max(List))
n=int(input())
a= [list(map(int, input().split())) for i in range(n)]
a1=float('inf')
a2=0
a3=float('inf')
a4=0

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


print(max(a2-a1,a4-a3))
n = int(input())
n_list = []
# dist_max = 0

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

print(max(n_list) - min(n_list))
arr = []; arr2 = []
for i in range(int(input())):
    a, b = list(map(int, input().split(" ")))
    arr.append([a, b])
    arr2.append([b, a])
# print(arr)
m1, m2 = min(arr), max(arr)
n1, n2 = min(arr2), max(arr2)
print(max(abs(m1[0]-m2[0]) + abs(m1[1] - m2[1]), abs(n1[0]-n2[0]) + abs(n1[1] - n2[1])))
N = int(input())
A = [map(int, input().split()) for _ in range(N)]

B = sorted([x+y for x,y in A])
print(B[-1] - B[0])
N = int(input())

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

ans = 0

for i in range(N):
    for j in range(N):
        if i == j:
            continue
        else:
            tmp = abs(list_x[i] - list_x[j]) + abs(list_x[i] - list_y[j])
            if tmp > ans:
                ans = tmp

print(ans)
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())

z_max=0
z_min=10**10
w_max=0
w_min=10**10

for i in range(n):
  x,y=nii()
  z=x+y
  z_max=max(z_max,z)
  z_min=min(z_min,z)

  w=x-y
  w_max=max(w_max,w)
  w_min=min(w_min,w)

ans=max(z_max-z_min,w_max-w_min)
print(ans)
N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]

cand = []

X.sort(key=lambda x: x[0])
cand.append(abs(X[0][0] - X[-1][0]) + abs(X[0][1] - X[-1][1]))

X.sort(key=lambda x: x[1])
cand.append(abs(X[0][0] - X[-1][0]) + abs(X[0][1] - X[-1][1]))

print(max(cand))
# coding: utf-8
n = int(input())
a=0
b=float('inf')
c=0
d=float('inf')
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)
print(max(abs(a-b),abs(c-d)))
n = int(input())
mi, ma = 1000000000000, 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)
def main():
    point_count = int(input())
    inf = 10 ** 9 * 2 + 1
    max_sum, min_sum, max_diff, min_diff = 0, inf, 0, inf
    for _ in range(point_count):
        x, y = [int(x) for x in input().split()]
        max_sum = max(x + y, max_sum)
        min_sum = min(x + y, min_sum)
        max_diff = max(x - y, max_diff)
        min_diff = min(x - y, min_diff)
    return max(max_sum - min_sum, max_diff - min_diff)


if __name__ == '__main__':
    print(main())
N=int(input())
P=[tuple(map(int,input().split())) for _ in [0]*N]


if N>=4:
    P.sort(lambda x:x[0])
    goodP=[P[0],P[-1]]

    P.sort(lambda x:x[1])
    goodP.append(P[0])
    goodP.append(P[-1])
else:
    goodP=P[:]
    
res=[]
for i in range(len(goodP)):
    for j in range(len(goodP)):
        if not i<j:
            continue
        res.append(abs(goodP[i][0]-goodP[j][0])+abs(goodP[i][1]-goodP[j][1]))
print(max(res))
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
data = []
for i in range(n):
	x,y = readInts()
	data.append([x+y,x,y])

data.sort(key=lambda x:x[0])

print(abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
n = int(input())
x = [None]*n
y = [None]*n

for i in range(n):
    x[i],y[i] = map(int,input().split())
    
d_from0 = 0
p_far = 0
x_0 = x[0]
y_0 = y[0]

for i in range(n):
    d = abs(x[i]-x_0)+abs(y[i]-y_0)
    if d > d_from0:
        d_from0 = d
        p_far = i

x_p = x[p_far]
y_p = y[p_far]

ans = 0

for i in range(n):
    d = abs(x[i]-x_p)+abs(y[i]-y_p)
    if d > ans:
        ans = d
print(ans)
minn=10**18
maxx=-10**18
for _ in range(input()):
    x,y=[int(i)+10**9 for i in raw_input().split()]
    minn=min(minn,x+y)
    maxx=max(maxx,x+y)
print maxx-minn
n=int(input())
l=[]
for i in range(n):
  x,y=map(int, input().split())
  l.append(x+y)
print(max(l)-min(l))
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] + i
        res = max(res, cur - smallest)
        smallest = min(smallest, cur)
print(res-1)
n=int(input())
xy=[list(map(int,input().split()))for _ in range(n)]
xy1ma=0
xy1mi=10**10
xy2ma=0
xy2mi=10**10
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(raw_input())
points = set([])
for _ in range(n):
	p = map(int, raw_input().split())
	points.add(tuple(p))
points = list(points)
def distance(p,q): return abs(p[0] - q[0]) + abs(p[1] - q[1])


def f(points):
	r = 0
	pss = []
	for u in [-1,1]:
		for v in [-1,1]: 	
			pss.append(max(points, key = lambda x:(u*x[0],v*x[1])))
	for p in pss:
		for q in points: r = max(r, distance(p,q))
	return r
print f(points)
n = int(input())

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

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)
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[k]) + abs(y[s] - y[k]):
		max = abs(x[s] - x[k]) + abs(y[s] - y[k])
print(max)
N = int(input())
xy = []
xmin , xmax, ymin, ymax= 10 ** 9, 0, 10 ** 9, 0
for _ in range(N):
    x, y = map(int, input().split())
    if x + y <= xmin + ymin:
        xmin = x
        ymin = y
    if x + y >= xmax + ymax:
        xmax = x
        ymax = y

print(xmax - xmin + ymax - ymin)
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
maxx = 0

result = [0]
for i in range(n):
  if maxx < 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())
a=[]
b=[]
for _ in range(n):
  x,y=map(int,input().split())
  a+=[abs(x-y)]
  b+=[x+y]
a.sort()
b.sort()
print(max(a[-1]-a[0],b[-1]-b[0]))
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(abs(x[d][0]-x[c][0])+abs(x[d][1]-x[c][1]))
import numpy as np
N=int(input())
X=[]
for i in range(N):
  array = list(map(int,input().split()))
  X.append(array)


a = np.array(X).T

xmax=[]
xmin=[]
xmax=np.argmax(a,axis=1)
xmin=np.argmin(a,axis=1)


x1=X[xmax[0]]
y1=X[xmax[1]]
x0=X[xmin[0]]
y0=X[xmin[1]]
print(x1)

x=abs(x1[0]-x0[0])+abs(x1[1]-x0[1])
y=abs(y1[0]-y0[0])+abs(y1[1]-y0[1])

print(max(x,y))
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
ans = 0
ur = sorted(xy, key=lambda x: x[0]+x[1])[-1]
ul = sorted(xy, key=lambda x: x[1]-x[0])[-1]
dr = sorted(xy, key=lambda x: x[0]-x[1])[-1]
dl = sorted(xy, key=lambda x: -x[0]-x[1])[-1]

ans = max(ans, abs(ur[0]-dl[0])+abs(ur[1]-dl[1]))
ans = max(ans, abs(ul[0]-dr[0])+abs(ul[1]-dr[0]))
print(ans)
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

ans = []
B = sorted([x+y for x,y in A])
ans.append(B[-1] - B[0])

# min_y - max_x
ax = sorted(A, key=lambda a: a[0])[-1]
ay = sorted(A, key=lambda a: a[1])[0]
ans.append(abs(ax[0] - ay[0]) + abs(ax[1] - ay[1]))

print(max(ans))
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
l.sort()
t=l[-1][0]-l[0][0]+l[-1][1]-l[0][1]
l.sort(key=lambda x: (x[1],x[0]))
# print(l)
t=max(t,l[-1][0]-l[0][0]+l[-1][1]-l[0][1])
print(t)
n = int (input())

xy = []

def dist(a, b):
    return abs(a[0]-b[0]) + abs(a[1]-b[1])
    
for i in range(n):
    x, y = map(int,input().split())
    xy.append([x, y])

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

dist(xy[0], xy[-1])


ans = 0
l = int((n//2)**0.5)
for i in range(l):
    for j in range(l+1):
        ans = max(ans, dist(xy[i], xy[n-1-j]))

print(ans)
n = int(input())
points = []
min1, max1 = float('inf'), float('-inf')
min2, max2 = float('inf'), float('-inf')

for tp in range(n):
    x, y = map(int, input().split())
    max1 = max(max1, x+y)
    min1 = min(min1, x+y)

    max2 = max(max1, x-y)
    min2 = max(min2, x-y)
    
ans = max(max1 - min1, max2 - min2)
print(ans)
N=int(input())
XY=[list(map(int,input().split())) for i in range(N)]
x0,y0=XY[0]
d=0
p,q=XY[0]
for x,y in XY:
    if abs(x-x0)+abs(y-y0)>d:
        p,q=x,y
        d=abs(x-x0)+abs(y-y0)
d=0
for x,y in XY:
    if abs(x-p)+abs(y-q)>d:
        d=abs(x-p)+abs(y-q)
print(d)
n = int(input())
arr = []
for _ in range(n):
    x,y = map(int,input().split(' '))
    arr.append([x,y])
    
arr.sort(key = lambda x:x[0])
ans1 = abs(arr[0][0]-arr[-1][0]) + abs(arr[0][1] - arr[-1][1])

arr.sort(key = lambda x:x[1])
ans2 = abs(arr[0][0]-arr[-1][0]) + abs(arr[0][1] - arr[-1][1])

print(max(ans1,ans2))
INF=10**6
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))
n=int(input())

max_d=(1,1)
min_d=(10**9,10**9)
for _ in range(n):
  x,y=map(int,input().split())
  d=(x,y)
  if sum(max_d)<sum(d):
    max_d=d
  if sum(min_d)>sum(d):
    min_d=d
print(sum(max_d)-sum(min_d))
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 < p-q:
        c = p-q
    if d > p-q:
        d = p-q

print(max(a-b,c-d))
n = int(input())
xsum = []
for i in range(n): 
  a, b = map(int, input().split())
  xsum.append(a+b)

result = abs(min(xsum)-max(xsum))
print(result)
n = int(input())
xy = [[int(i) for i in input().split()] for j in range(n)]

a = xy[0][0]
b = xy[0][1]

m_len = -1

for i in range(n-1):
    tmp = abs(xy[i+1][0]-a)+abs(xy[i+1][1]-b)
    if m_len < tmp:
         m_len = tmp
         idx = i

a = xy[i][0]
b = xy[i][1]

for i in range(n):
    if i == idx:
        continue
    tmp = abs(xy[i][0]-a)+abs(xy[i][1]-b)
    if m_len < tmp:
        m_len = tmp
        
print(m_len)
n = int(input())
lst, result = [], []

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

for i in range(n - 1):
    a = lst[i][0] - lst[i + 1][0]
    b = lst[i][1] - lst[i + 1][1]
    result.append(abs(a) + abs(b))

print(max(result))
N = int(input())
i = 0
x = [0]
y = [0]
for i in range(N):
    a, b = map(int, input().split())
    x.append(a)
    y.append(b)
    ma = max(x[i+1]*y[i+1], x[i]*y[i])
    mi = min(x[i+1]*y[i+1], x[i]*y[i])
    if ma == x[i+1]*y[i+1]:
        cma = i
    if mi == x[i+1]*y[i+1]:
        cmi = i
    i += 1
print(abs(x[cma] - x[cmi]) + abs(y[cma] - y[cmi]))
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
maxx = 0

result = [0]
for i in range(n):
  if maxx < i:
    for j in range(n - 1):
      result.append(abs(x[i] - x[j]) + abs(y[i] - y[j]))
      maxx = x[i]
print(max(result))
N = int(input())
ma = 0
mi = 10**18
for i in range(N):
    x,y = map(int,input().split())
    ma=max(ma,x+y)
    mi=min(mi,x+y)
print(ma-mi)
N=int(input())
xy=[map(int,input().split()) for i in range(0,N-1)]
x,y=[list(j) for j in zip(*xy)]

m=0
for k in range(0,len(x)-1):
  for l in range(k,len(y)):
  
      if abs(x[k]-x[l])+abs(y[k]-y[l])>m:
         m=abs(x[k]-x[l])+abs(y[k]-y[l])
    
print(m)
import math
n=int(input())
c,v,b,m=0,0,0,0
for i in range(n):
    x,y=map(int,input().split())
    c=max(x+y,c)
    if i==0:
        v=x+y
    else:
        v=min(x+y,v)

    
    if math.fabs(x-y)>b:
        m=b
    b=max(math.fabs(x-y),b)
print(int(max(c-v, b+m)))
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,len(x)):
    temp = abs(x[i] - x[j]) + abs(y[i] - y[j])
    distance.append(temp)
print(distance)

max = distance[0]
 
for i in range(1,len(distance)-1):
  if distance[i] >= max:
    max = distance[i]
 
print(max)
n = int(input())
x = [0 for _ in range(n)]
for i in range(n):
    x[i] = list(map(int, input().split()))
x.sort(key = lambda s:s[0])
ans = 0
for i in x:
    ans = max(ans, abs(x[0][0] - i[0]) + abs(x[0][1] - i[1]))
x.sort(key = lambda w:w[1])
for i in x:
    ans = max(ans, abs(x[0][0] - i[0]) + abs(x[0][1] - i[1]))
print(ans)
N = int(input())

x_plus_y = set()
x_minus_y = set()

for _ in range(N):
    x, y = map(int, input().split())
    x_plus_y.add(x+y)
    x_minus_y.add(x+y)

print(max([abs(max(x_plus_y)-min(x_plus_y)), abs(max(x_minus_y)-min(x_minus_y))]))
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

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

for x,y in XY:
    min_diff = min(abs(x-y), min_diff)
    max_diff = max(abs(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))
N = int(input())
p = [list(map(int, input().split())) for _ in range(N)]
a = []

for i, pos in enumerate(p):
    a.append((sum(pos), i))

a.sort(key=lambda x:x[0])

xi, yi = p[a[0][1]]
xj, yj = p[a[-1][1]]

print(abs(xi - xj) + abs(yi - yj))
N = int(input())
xy = []
x1 = 0
y1 = 0
for _ in range(N):
    x, y = map(int, input().split())
    xy.append([x, y])
    if abs(x) + abs(y) > abs(x1) + abs(y1):
        x1 = x
        y1 = y
ans = 0
for x, y in xy:
    ans = max(ans, abs(x1 - x) + abs(y1 - y))
print(ans)
from collections import defaultdict
dic = defaultdict(list)
N = int(input())
l = []
z = []
for _ in range(N):
    x, y = map(int, input().split())
    l.append([x, y])
    z.append(x+y)
z.sort()
temp = z[-1]-z[0]
    
for t in l:
    a = t[0]+t[1]
    dic[a].append(t)
for u in dic:
   
    dic[u].sort()
    b = dic[u][-1][0]-dic[u][0][0]
    ans = max(2*b, temp)
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)
print(abs(max(max(a),max(b)))-abs(min(min(a),min(b))))
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]-x[i])
    Y.append(x[i]+y[i])

dam1 = max(X) - min(X)
dam2 = max(Y) - min(Y)
print(max(dam1,dam2))
N = int(input())
plus = []
for i in range(N):
    x,y = map(int,input().split())
    plus.append([x+y,x,y])
plus.sort()

ans = 0
fxy,fx,fy = plus[0]
for i in range(1,N):
    sxy,sx,sy = plus[i]
    if fxy == sxy:
        if fx != sx or fy != sy:
            ans = max(ans, abs(fx-sx)+abs(fy-sy))
    else:
        ans = max(ans, sxy-fxy)
print(ans)
N=int(input())
kouho=[0]*4#xmax,ymax,xmin,ymin
kouho[2]=10**9+1
kouho[3]=10**9+1
ans=0
for i in range(N):
    x,y=map(int,input().split())
    newx=x-y
    newy=x+y
    if newx>kouho[0]:
        kouho[0]=newx
    if newx<kouho[2]:
        kouho[2]=newx
    if newy>kouho[1]:
        kouho[1]=newy
    if newy<kouho[3]:
        kouho[3]=newy
ans=max(kouho[0]-kouho[2],kouho[1]-kouho[3])
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]
if (x1 <= x2 and y1 <= y2) or (x1 >= x2 and y1 >= y2):
    print(abs((x1 + y1) - (x2 + y2)))
else:
    print(abs((x1 - y1) - (x2 + y2)))
import math

n = int(input())

x = list(range(n))
y = list(range(n))
m = list(range(n))
for i in range(n):
  x[i],y[i] = map(int,input().split())
  m[i] = x[i] + y[i]
m.sort()
res = abs(m[0]-m[n-1])
print(res)
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] + i[1])
py = sorted(p, key=lambda i: abs(i[0] - i[1]))
print(max(abs(sum(px[0]) - sum(px[-1])), abs(sum(py[0]) - sum(py[-1]))))
import numpy as np
N=int(input())
X=[]
for i in range(N):
  array = list(map(int,input().split()))
  X.append(array)


a = np.array(X).T

xmax=[]
xmin=[]
xmax=np.argmax(a,axis=1)
xmin=np.argmin(a,axis=1)


x1=X[xmax[0]]
y1=X[xmax[1]]
x0=X[xmin[0]]
y0=X[xmin[1]]


x=abs(x1[0]-x0[0])+abs(x1[1]-x0[1])
y=abs(y1[0]-y0[0])+abs(y1[1]-y0[1])

print(max(x,y))
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,x-y)
  q=max(q,x-y)
  
print(max(t-s,q-p))