Buggy python submission (verdict: Runtime Error):
n = int(input())
c = []
for _ in range(n):
    c.append(list(map(int,input().split())))

ans = 0
a = 100000000000000
m = 0
lm = 0
rm = 0
lt  = []
rt  = []
lb = []
rb = []

for l in c:
    m = max(m,l[0]+l[1])
    a = min(a,l[0]+l[1])
    if l[0] > l[1]:
        rm = max(rm,l[0]-l[1])
    if l[0] < l[1]:
        lm = max(lm,l[1]-l[0])

for l in c:
    if l[0] + l[1] == m:
        rt.append(l)
    if l[0] + l[1] == a:
        lb.append(l)
    if l[0] > l[1] and l[0] - l[1] == rm:
        rb.append(l)
    if l[0] < l[1] and l[1] - l[0] == lm:
        lt.append(l)


if lt is not None and rb is not None:
    i = lt[0]
    j = rb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))

if rt is not None and lb is not None:
    i = rt[0]
    j = lb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))
print(ans)




Fixed submission:
n = int(input())
c = []
for _ in range(n):
    c.append(list(map(int,input().split())))

ans = 0
a = 100000000000000
m = 0
lm = 0
rm = 0
lt  = []
rt  = []
lb = []
rb = []

for l in c:
    m = max(m,l[0]+l[1])
    a = min(a,l[0]+l[1])
    if l[0] > l[1]:
        rm = max(rm,l[0]-l[1])
    if l[0] < l[1]:
        lm = max(lm,l[1]-l[0])

for l in c:
    if l[0] + l[1] == m:
        rt.append(l)
    if l[0] + l[1] == a:
        lb.append(l)
    if l[0] > l[1] and l[0] - l[1] == rm:
        rb.append(l)
    if l[0] < l[1] and l[1] - l[0] == lm:
        lt.append(l)


if len(lt)>0 and len(rb) > 0:
    i = lt[0]
    j = rb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))

if len(rt)>0 and len(lb) > 0:
    i = rt[0]
    j = lb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
c = []
for _ in range(n):
    c.append(list(map(int,input().split())))

ans = 0
a = 100000000000000
m = 0
lm = 0
rm = 0
lt  = []
rt  = []
lb = []
rb = []

for l in c:
    m = max(m,l[0]+l[1])
    a = min(a,l[0]+l[1])
    if l[0] > l[1]:
        rm = max(rm,l[0]-l[1])
    if l[0] < l[1]:
        lm = max(lm,l[1]-l[0])

for l in c:
    if l[0] + l[1] == m:
        rt.append(l)
    if l[0] + l[1] == a:
        lb.append(l)
    if l[0] > l[1] and l[0] - l[1] == rm:
        rb.append(l)
    if l[0] < l[1] and l[1] - l[0] == lm:
        lt.append(l)


for i in lt:
    for j in rb:
        ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))

for i in rt:
    for j in lb:
        ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))
print(ans)




Fixed submission:
n = int(input())
c = []
for _ in range(n):
    c.append(list(map(int,input().split())))

ans = 0
a = 100000000000000
m = 0
lm = 0
rm = 0
lt  = []
rt  = []
lb = []
rb = []

for l in c:
    m = max(m,l[0]+l[1])
    a = min(a,l[0]+l[1])
    if l[0] > l[1]:
        rm = max(rm,l[0]-l[1])
    if l[0] < l[1]:
        lm = max(lm,l[1]-l[0])

for l in c:
    if l[0] + l[1] == m:
        rt.append(l)
    if l[0] + l[1] == a:
        lb.append(l)
    if l[0] > l[1] and l[0] - l[1] == rm:
        rb.append(l)
    if l[0] < l[1] and l[1] - l[0] == lm:
        lt.append(l)


if len(lt)>0 and len(rb) > 0:
    i = lt[0]
    j = rb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))

if len(rt)>0 and len(lb) > 0:
    i = rt[0]
    j = lb[0]
    ans = max(ans,abs(i[0]-j[0])+abs(i[1]-j[1]))
print(ans)