Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):



from math import *
from copy import *                      
from heapq import *                     
from string import *                    
from random import *                    
from bisect import *                    
from sys import stdin                   
from sys import maxsize                 
from operator import *                  
from itertools import *                 
from decimal import Decimal             
from collections import Counter         
from collections import defaultdict     



def solve(l):
	n = len(l)
	d = defaultdict(int)
	ll = []
	for x,y in l:
		ll.append(x+y)
	return abs(min(ll) - max(ll))

N = int(stdin.readline())
L = []
for i in range(N):
	a,b = map(int, input().split())
	L.append([a,b])
ans = solve(L)
print(ans)



Failing test case input:
2
1 44
2 -1

Expected output:
46


Actual output:
44


Fixed submission (verdict: Accepted):



from math import *
from copy import *                      
from heapq import *                     
from string import *                    
from random import *                    
from bisect import *                    
from sys import stdin                   
from sys import maxsize                 
from operator import *                  
from itertools import *                 
from decimal import Decimal             
from collections import Counter         
from collections import defaultdict     



def solve(l):
	n = len(l)
	d = defaultdict(int)
	l1,l2,l3 = [],[],[]
	for x,y in l:
		l1.append(x+y)
		l2.append(x-y)
		l3.append(y-x)
	a = abs(max(l1) - min(l1))
	b = abs(max(l2) - min(l2))
	c = abs(max(l3) - min(l3))
	return max(a,b,c)

N = int(stdin.readline())
L = []
for i in range(N):
	a,b = map(int, input().split())
	L.append([a,b])
ans = solve(L)
print(ans)

Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
l = []
ll = []
for _ in range(n):
    x, y = map(int, input().split())
    l.append((x+y, x, y))
    ll.append((x-y, x, y))
l.sort()
ll.sort()
ans1 = 0
ans2 = 0

cnt = 0
while True:
    a = l[-cnt]
    b = l[cnt]
    if a[1] >= b[1] and a[2] >= b[2]:
        ans1 = abs(b[0]-a[0])
        break
    if cnt >= n-1:
        break
    cnt += 1

cnt = 0
while True:
    a = l[-cnt]
    b = l[cnt]
    if a[1] >= a[2] and b[2] >= b[1]:
        ans2 = abs(b[0]-a[0])
        break
    if cnt >= n-1:
        break
    cnt += 1

print(max(ans1, ans2))


Failing test case input:
3
-1 -4
1 -1
-23 0

Expected output:
26


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
l = []
ll = []
for _ in range(n):
    x, y = map(int, input().split())
    l.append((x+y, x, y))
    ll.append((x-y, x, y))
l.sort()
ll.sort()
ans1 = 0
ans2 = 0



cnt = 0
while True:
    a = l[n-1-cnt]
    b = l[cnt]
    
    if a[1] >= b[1] and a[2] >= b[2]:
        ans1 = abs(b[0]-a[0])
        
        break
    if cnt >= n-1:
        break
    cnt += 1

cnt = 0
while True:
    a = ll[n-1-cnt]
    b = ll[cnt]
    if a[1] >= b[1] and b[2] >= a[2]:
        ans2 = abs(b[0]-a[0])
        
        break
    if cnt >= n-1:
        break
    cnt += 1

print(max(ans1, ans2))