peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
a_max = 2
a_min = 2*(10**9)
s_max = 0
s_min = 10**9

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

    if add > a_max:
        a_max = add
    if add < a_min:
        a_min = add
    if sub > s_max:
        s_max = sub
    if sub < s_max:
        s_max = sub

d_add = a_max - a_min
d_sub = s_max - s_min

print(max(d_add,d_sub))
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(8):
  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())
xys = [tuple(map(int, input().split())) for _ in range(N)]

far = 0
dist = 0
x0 = xys[0][0]
y0 = xys[0][1]
for i, (x, y) in enumerate(xys):
    if abs(x - x0) + abs(y - y0) > dist:
        dist = abs(x - x0) + abs(y - y0)
        far = i

x0, y0 = xys[i]
far = 0
for i, (x, y) in enumerate(xys):
    if abs(x - x0) + abs(y - y0) > dist:
        dist = abs(x - x0) + abs(y - y0)
        far = i

print(dist)
n=int(input())
M=[]
for i in range(n):
    x,y=map(int,input().split())
    M.append(x+y)
print(max(M)-min(M))
n=int(input())
D=0
d=10**9+1
for i in range(n):
    x,y=[int(x) for x in input().split()]
    l=x+y
    d=min(d,l)
    D=max(D,l)
print(D-d)
n = int(input())
maxPlus, minPlus, maxMinus, minMinus = 0, 10**9 , 0, 10**9
for _ in range(n):
    x, y = map(int, input().split())
    maxPlus = max(x + y, maxPlus)
    minPlus = min(x + y, minPlus)
    maxMinus = max(abs(x - y), maxMinus)
    minMinus = min(abs(x - y), minMinus)
print(max(abs(maxPlus - minPlus), abs(maxMinus - minMinus)))
n = int(input())
x = [0]*n
for i in range(n):
    x[i] = list(map(int,input().split()))

z = [0]*n
d = [0]*n
for i,[x,y] in enumerate(x) :
    z[i] = [x-y,x+y]
    d[i] = max(x-y,x+y)
print(max(d)-min(d))
n=int(input())
l=[input().split() for _ in range(n)]
dp=[0]*n*2
dp1=[0]*n*2
for i in range(n):
    for j in range(1,n):
        dp[i+j] = max(abs(int(l[i][0]) - int(l[j][0])), dp[i+j-1])
        dp1[i+j] = max(abs(int(l[i][1]) - int(l[j][1])), dp[i+j-1])
dp=sorted(dp)
dp1=sorted(dp1)
print(int(dp[-1])+int(dp1[-1]))
n=int(input())
l=[]
lan=[]
for i in range(n):
  ll=list(map(int,input().split()))
  l.append(ll)
  ll1=[ll[1],ll[0]]
  lan.append(ll1)

l.sort()
lan.sort()
we=abs(l[0][0]-l[-1][0])+abs(l[0][1]-l[-1][1])
we1=abs(lan[0][0]-lan[-1][0])+abs(lan[0][1]-lan[-1][1])
print(max(we,we1))
n = int(input())
x = []
for i in range(n):
    a,b = (map(int,input().split()))
    x.append(a+b)
ans = max(x) - min(x)
print(ans)
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
  x[i], y[i] = map(int, input().split())

m = 0
mp = 0
for i in range(N):
  d = abs(x[i]-x[0])+abs(y[i]-y[0])
  if d>m:
    m = d
    mp = i

ans = 0
for i in range(N):
  ans = max(ans, abs(x[i]-x[mp])+abs(y[i]-y[mp]))

print(ans)
n = int(input())

xmax = 0
xmin = 10**9
ymax = 0
ymin = 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)
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
mod = 10 ** 9 + 7; INF = float("inf")

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

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

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





if __name__ == '__main__':
	main()
from collections import defaultdict
N = int(input())
Min = float('inf')
Max = 0
Sum_y = defaultdict(lambda:[])
for i in range(N):
    x,y = map(int,input().split())
    Sum = x+y
    Min = min(Min,Sum)
    Max = max(Max,Sum)
    Sum_y[Sum].append(y)
ans = Max-Min

for key in Sum_y.keys():
    ans = max(ans,2*(max(Sum_y[key])-min(Sum_y[key])))
print(ans)
import sys
input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)

def li():
    return [int(x) for x in input().split()]


N = int(input())
A = []
B = []
C = []
D = []
for i in range(N):
    x, y = li()
    A.append(x + y)
    B.append(abs(x - y))
    C.append(abs(-x + y))
    D.append(abs(-x - y))

maxA = max(A)
minA = min(A)
maxB = max(B)
minB = min(B)
maxC = max(C)
minC = min(C)
maxD = max(D)
minD = min(D)
ans = max(maxA - minA, maxB - minB, maxC - minC, maxD - minD)
print(ans)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
point_dict = {}
for i in range(n):
    x, y = map(int, input().split())
    point_dict[(x, y)] = x + y
print(max(point_dict.values()) - min(point_dict.values()))
input=__import__('sys').stdin.readline
n=int(input())
s=[]
for _ in range(n):
    s+=[*map(int,input().split())],
s.sort()
ans=0
ans=max(ans,abs(s[0][0]-s[-1][0])+abs(s[0][1]-s[-1][1]))
s.sort(key=lambda x:x[1])
ans=max(ans,abs(s[0][0]-s[-1][0])+abs(s[0][1]-s[-1][1]))
print(ans)
N = int(input())
coordinates = []
for i in range(N):
    coordinate = list(map(int, input().split()))
    coordinates.append(coordinate)
max_dist = 0
coordinates = sorted(coordinates)
for i in range(1, N):
    dist = abs(coordinates[0][0] - coordinates[i][0]) + abs(coordinates[0][1] - coordinates[i][1])
    if max_dist < dist:
        max_dist = dist
print(max_dist)
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(p-r, q-s))
mod=10**9+7
N=int(input())
print((10**N-(2*9**N)+(8**N))%mod)
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())
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] + i
        res = max(res, cur - smallest)
        smallest = min(smallest, cur)
print(res-1)
def main():
    n = int(input())
    coords = []
    for i in range(n):
        x,y = map(int,input().split())
        coords.append(x+y)

    coords.sort()
    print(coords[-1]-coords[0])
    


main()
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])

ans = 0
for i in range(min(1000, N)):
    xi, yi = p[a[i][1]]
    xj, yj = p[a[N - i -1][1]]
    ans = max(ans, abs(xi - xj) + abs(yi - yj))
print(ans)
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
maxx = -10 ** 10
maxy = -10 ** 10

result = [0]
for i in range(n):
  if maxx <= x[i] and maxy <= y[i]:
    for j in range(n):
      result.append(abs(x[i] - x[j]) + abs(y[i] - y[j]))
      maxx = x[i]
      maxy = y[i]
print(max(result))
n = int(input())
max_t = -float('inf')
min_t = float('inf')
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
print(max_t - min_t)
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,x-y)
  mi = min(mi,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)
  
ans = max(ans, ma - mi)
if ans<0:
  while True:
    continue
print(ans)
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(1,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())
i, j, k = 0, 0, 0
x = [0]
y = [0]
while i < 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 = input()
n = int(n)

p = []
for i in range(n):
  x,y = map(int, input().split(' '))
  p.append([x, y])

maXP = max(p, key=lambda x:x[0])
miXP = min(p, key=lambda x:x[0])
maYP = max(p, key=lambda x:x[1])
miYP = min(p, key=lambda x:x[1])
mp = [maXP, miXP, maYP, miYP]
md = -1
for i in range(3):
  for j in range(i+1, 4):
    x1, y1 = mp[i]
    x2, y2 = mp[j]
    md = abs(x1 - x2) + abs(y1 - y2)
    md = int(md)
print(md)
n=int(input())
ansx=[]
ansy=[]
for i in range(n):
    x,y=map(int,input().split())
    ansx.append([x,y])
    ansy.append([y,x])

ansx=sorted(ansx)
ansy=sorted(ansy)
ans=0
for i in range(n-1):
    ans=max(ans,ansx[i+1][0]-ansx[0][0]+abs(ansx[0][1]-ansx[i+1][1]))
for i in range(n-1):
    ans=max(ans,ansy[i+1][0]-ansy[0][0]+abs(ansy[0][1]-ansy[i+1][1]))
print(ans)
def dist(p, q):
    return abs(p[0] - q[0]) + abs(p[1] - q[1])

n = int(input())
P = [tuple(map(int, input().split())) for _ in range(n)]
P.sort()
ans = dist(P[0], P[1])
P.sort(key=lambda p: (p[0], -p[1]))
ans = max(ans, dist(P[0], P[-1]))
P.sort(key=lambda p: (p[1], p[0]))
ans = max(ans, dist(P[0], P[-1]))
P.sort(key=lambda p: (p[1], -p[0]))
ans = max(ans, dist(P[0], P[-1]))
print(ans)
N = int(input())
xy = [list(map(int,input().split())) for _ in range(N)]

man = [0] * N
for i in range(N):
    man[i] = xy[i][0] + xy[i][1]
print(max(man) - min(man))
n=int(input())
xbox=[]
ybox=[]
for i in range(n):
    x,y = map(int,input().split())
    xbox.append(x)
    ybox.append(y)
xmax=max(xbox)
ymax=max(ybox)
box=[]
for i in range(n):
    box.append(xmax+ymax-xbox[i]-ybox[i])
print(max(box)-min(box))
N=int(input())
xy=[tuple(map(int,input().split())) for _ in range(N)]
t=[]
for x,y in xy:
    t.append((x*y,x,y))
t=sorted(t)
tt=[]
tt.append(t[0])
tt.append(t[-1])
t=sorted(t,key=lambda x:x[1])
tt.append(t[0])
tt.append(t[-1])
t=sorted(t,key=lambda x:x[2])
tt.append(t[0])
tt.append(t[-1])
n=len(tt)
ans=0
for i in range(n):
    for j in range(i+1,n):
        ans=max(ans,abs(tt[i][1]-tt[j][1])+abs(tt[i][2]-tt[j][2]))
print(ans)
N=int(input())
answer=0

xylist=[]
pxylist=[]
mxylist=[]
for _ in range(N):
  x,y=map(int,input().split())
  xylist.append((x,y))
  pxylist.append(x+y)
  mxylist.append(x-y)
pxylist.sort()
mxylist.sort()

answer=max(pxylist[-1]-pxylist[0],mxylist[-1],mxylist[0])
print(answer)
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((x + y))
  count4.append((x - y))
z = min(count3)
zz = min(count4)
print(max(count-z, count2-zz))
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)
import sys
input = sys.stdin.readline
n = int(input())
xy = tuple(map(int, input().split()))
M = sum(xy)
Mxy = xy
m = M
mxy = xy
for _ in range(n - 1):
    xy = tuple(map(int, input().split()))
    s = sum(xy)
    if s > M:
        M = s
        Mxy = xy
    if s < m:
        m = s
        mxy = xy
print(abs(Mxy[0]-mxy[0])+abs(Mxy[1]-mxy[1]))
n = int(input())
a = []
b = []
for i in range(n):
  x,y = map(int, input().split())
  a.append(x+y)
  b.append(abs(x-y))
a.sort()
b.sort()

ans = a[-1]-a[0]
c = b[-1]-b[0]
print (max(ans,c))
N = int(input())
tmp1 = []

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

if len(tmp1) > 0:
    tmp = []
    for i in range(len(tmp1)):
        tmp.append(tmp1[i][2])
    ans = max(tmp)-min(tmp)
    
print(ans)
input=__import__('sys').stdin.readline
def getdist(a,b):return abs(a[0]-b[0])+abs(a[1]-b[1])
n=int(input())
s=[]
for _ in range(n):
    s+=[*map(int,input().split())],
s.sort()
ans=0
for i in s:
    ans=max(ans,getdist(s[0],i))
    ans=max(ans,getdist(s[-1],i))
s.sort(key=lambda x:x[1])
for i in s:
    ans=max(ans,getdist(s[0],i))
    ans=max(ans,getdist(s[-1],i))
print(ans)
n = int(input())
maxx, minx, maxy, miny = -1**10, 1**10, -1**10, 1**10
for _ in range(n):
	x, y = map(int, input().split())
	x, y = x+y, x-y
	maxx = max(maxx, x)
	minx = min(minx, x)
	maxy = max(maxy, y)
	miny = min(miny, y)
print(max(maxx - minx, maxy - miny))
N = int(input())
v = [list(map(int, input().split())) for i in range(N)]
v.sort(key = lambda x:abs(x[0]) + abs(x[1]))
d = abs(v[0][0] - v[N-1][0]) + abs(v[0][1] - v[N-1][1])
print(d)
N = int(input())
x = []
for _ in range(N):
    x.append(list(map(int, input().split())))

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


def dist(x_1, y_1, x_2, y_2):
    return abs(x_1 - x_2) + abs(y_1 - y_2)


ans = 0

for i in range(1, N):
    tmp = dist(*x[i], *x[0])
    if tmp > ans:
        ans = tmp

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

for i in range(1, N):
    tmp = dist(*x[i], *x[0])
    if tmp > ans:
        ans = tmp

print(ans)
import sys
from itertools import combinations
def input(): return sys.stdin.readline().strip()


def main():
    """
    https://www.quora.com/How-can-I-find-the-maximum-Manhattan-distance-between-2-points-from-a-given-set-of-points
    """
    N = int(input())
    x, y = map(int, input().split())
    maximal = x + y
    minimal = x + y
    for _ in range(N - 1):
        x, y = map(int, input().split())
        maximal = max(maximal, x + y)
        minimal = min(minimal, x + y)
    print(maximal - minimal)


if __name__ == "__main__":
    main()
N = int(input())
ls = []
for i in range(N):
    x,y = map(int,input().split())
    ls.append(x+y)
print(max(ls)-min(ls))
n=int(input())
a_list=[list(map(int,input().split())) for i in range(n)]
A=[]
for i in range(n):
    A.append(a_list[i][0]**2+a_list[i][1]**2)
X=A.index(max(A))
X=int(X)
Y=A.index(min(A))
Y=int(Y)
print(abs(a_list[X][0]-a_list[Y][0])+abs(a_list[X][1]-a_list[Y][1]))
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())

if n==1:
  print(0)
  exit()

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())
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(abs(max-min))
N =  int(input())
A =  [list(map(int, (input().split(' ')))) for i in range(N)]

hoge = [sum(a) for a in A]
print(max(hoge) - min(hoge))
N = int(input())
Array = []
for i in range(N):
    next_x, next_y = map(int, input().split())
    Array.append([next_x,next_y])

print(Array)
Array2 = []
Point1x = 0
Point1y = 0
Point2x = 0
Point2y = 0
for i in range(N):
    for j in range(N):
        Point1x = Array[i][0]
        Point1y = Array[i][1]
        Point2x = Array[j][0]
        Point2y = Array[j][1]
        Dist = abs(Point1x-Point2x) + abs(Point1y-Point2y)
        Array2.append(Dist)

print(max(Array2))
n = int(input())
tab = []
rtab = []
for i in range(n):
	a, b = map(int, input().split())
	tab.append([a, b])
	rtab.append([b, a])
tab.sort()
rtab.sort()
m = 0

j = n - 1
for i in range(n):
	m = max(m, abs(tab[i][0] - tab[j][0]) + abs(tab[i][1] - tab[j][1]))
	m = max(m, abs(rtab[i][0] - rtab[j][0]) + abs(rtab[i][1] - rtab[j][1]))
	j -= 1

print(m)
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,x-y)
  mi = min(mi,x-y)
ans = ma - mi


for x,y in xy:
  ma = max(ma,x+y)
  mi = min(mi,x+y)
  
ans = max(ans, ma - mi)
print(ans)
import math
n=int(input())
a,b=0,0
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)

   
    b=max(math.fabs(x-y),b)
    if i==0:
        m=math.fabs(x-y)
    else:
        m=min(math.fabs(x-y),m)
print(int(max(c-v, b-m)))
n = int(input())

M1, M2 = 0, 0
m1 = m2 = float('inf')

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

d1 = M1-m1
d2 = M2-m2

print(max(d1, d2))
n = int(input())
p = [list(map(int, input().split())) for i in range(n)]

a = 2000000000
b = 0
for x, y in p:
    a = min(a, x + y)
    b = max(b, x + y)
print(b - a)
n = int(input())
dist = []
max = -pow(10, 10)
min = pow(10, 10)
for i in range(n):
    x, y = (int(x) for x in input().split())
    if max < x + y:
        max = x + y
    if min > x + y:
        min = x + y
print(max-min)
N=int(input())

listA=[]

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

    except:
        break;
listB=set(listA)
print(max(listB)-min(listB))
import sys
input = sys.stdin.readline

N = int(input())
xy = [[int(i) for i in input().split()] for _ in range(N)]

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

d1.sort(reverse=True)
d2.sort(reverse=True)

print(max(
  d1[0] - d1[-1],
  d1[-1] - d1[0],
  d2[0] + d2[-1],
  d2[-1] - d2[0])
)
n=int(input())
D=0
d=10**10
for i in range(n):
    x,y=[int(x) for x in input().split()]
    l=x+y
    d=min(d,l)
    D=max(D,l)
print(D-d)
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())
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]]:
    for Y in [t[-1], u[-1]]:
        tmp = abs(X[0] - Y[0]) + abs(X[1] - Y[1])
        res = max(res, tmp)
print(res)
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

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

print(max(a,b))
n=int(input())
xy=[]
for i in range(n):
  tmp=list(map(int,input().split()))
  xy.append(tmp)
maxz,minz,maxw,minw=0,10**10,0,10**10
for i in range(n):
  maxz=max(maxz,xy[i][0]+xy[i][1])
  minz=min(minz,xy[i][0]+xy[i][1])
  maxw=max(maxw,xy[i][0]-xy[i][1])
  minw=min(minw,xy[i][0]-xy[i][1])
print(max(maxz-minz,maxw-minw))
N=int(input())
for i in range(N):
    x,y = map(int,input().split())
    if i == 0:
        max = x+y
        min = x+y
    else:
        if max > x+y:
            max = x+y
        if min < x+y:
            min = x+y
print(abs(max-min))
N = int(input())

Xmax = 0
Ymax = 0
Xmin = 2*10**9
Ymin = 2*10**9
for i in range(N):
    x, y = map(int, input().split())
    if (x + y > Xmax):
        Xmax = x + y
    if (x + y < Xmin):
        Xmin = x + y
    if (x - y > Ymax):
        Ymax = x - y
    if (x - y < Ymin):
        Ymin = x - y

print(max(Xmax - Xmin, Ymax - Ymin))
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)

   
    b=max(math.fabs(x-y),b)
    if i==0:
        m=math.fabs(x-y)
    else:
        m=min(math.fabs(x-y),m)
print(int(max(c-v, b-m)))
n = int(input())



mi, ma = 0, 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())
arr=[list(map(int,input().split())) for i in range(N)]

za,wa=0,0
zi,wi=10**10,10**10
for i in range(N):
    z=arr[i][0]+arr[i][1]
    w=arr[i][0]-arr[i][1]
    
    za=max(z,za)
    zi=min(z,zi)
    
    wa=max(w,wa)
    wi=min(w,wi)

print(max(za-zi,wa-wi))
n=int(input()) 
x,y=map(int, input().split())
mn = x+y
minx = x
miny = y
mx = x+y
maxx = x
maxy = y  

for i in range(n-1):
    x,y=map(int, input().split())
    if mn > x+y:
        mn = x+y
        minx = x
        miny = y
    elif mx < x+y:
        mx = x+y
        maxx = x
        maxy = y

print(abs(maxx-minx)+abs(maxy-miny))
n = int(input())
xy_array = [list(map(int, input().split())) for _ in range(n)]

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

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)
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 = p[0] + 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())
a = sorted([list(map(int, input().split(" "))) for i in range(n)])
base = a[0][0] + a[0][1]
maxi = 0
for i in range(n):
  if a[0][0] + a[0][1] > base:
    continue
  else:
    for j in range(i + 1, n):
      maxi = max(maxi, (a[j][0] - a[i][0]) + (a[j][1] - a[i][1]))
print(maxi)
n = int(input())

zmax = 0
zmin = 10**10
wmax = 0
wmin = 10**10

for i in range(n):
    x, y = map(int, input().split())
    zref = x + y
    wref = x - y
    zmax = max(zmax, zref)
    zmin = min(zmin, zref)
    wmax = max(wmax, wref)
    wmin = min(wmin, wref)

ans = max(zmax - zmin, wmax - wmin)
print(ans)
def LI():
    return list(map(int, input().split()))


pu = []
mi = []
N = int(input())
for _ in range(N):
    x, y = LI()
    pu.append(x+y)
    mi.append(x-y)
P = max(pu)
p = min(pu)
M = max(mi)
m = max(mi)
print(max(P-p, M-m))
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[:500])
c = c | set(xy[-500:])

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

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

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)
from sys import stdin
input = stdin.readline

N = int(input())

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

for i in range(N):
    xy[i].append(sum(xy[i]))

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

x, y, tmp = xy[0]
ans = 0

for i in range(1, N):
    ans = max(ans, abs(x - xy[i][0]) + abs(y - xy[i][1]))

print(ans)
n=int(input())
l1=[]
l2=[]
for _ in range(n):
    x,y=map(int,input().split())
    l1.append(x+y)
    l2.append(abs(x-y))
print(max(max(l1)-min(l1),max(l2)-min(l2)))
n=int(input())
a=[]
j=k=0
def s(a):
    return a[0]+a[1]
for i in range(n):
    f=list(map(int,input().split()))
    a.append(f)
print(max(map(s,a))-min(map(s,a)))
n = int(input())
list1 = []

for i in range(n):
  x, y = map(int, input().split())
  d = abs(x) + abs(y)
  list1.append(d)
ans = max(list1) - min(list1)
print(ans)
n = int(input())
x_list = []
y_list = []
for _ in range(n):
    x, y = map(int, input().split())
    x_list.append(x)
    y_list.append(y)
x_list.sort()
y_list.sort()
ans = x_list[-1] - x_list[0] + y_list[-1] - y_list[0]
print(ans)
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 = x - y
    Xmin = min(Xmin, X)
    Xmax = max(Xmax, X)
    Ymin = min(Ymin, Y)
    Ymax = max(Ymax, Y)
if Xmin == 1e9 + 5:
    Xmin = Xmax
if Ymin == 1e9 + 5:
    Ymin = Ymax
Z = max(Xmax - Xmin, Ymax - Ymin)
print(Z)