ZhenlongDai/ACPR huggingface dataset:
Problem: p02660
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math

def is_prime(n):
    if n==1:
        return False
    nmax = int(math.sqrt(n)) + 1
    for i in range(2, nmax):
        if(n%i)==0:
            return False
    return True

def pf(n):
    sn = int(math.sqrt(n)) + 1
    ps = []
    for i in range(1, sn):
        if (n%i)==0:
            ps.append(i)
    del ps[0]
    if not ps:
        ps.append(n)
    return ps        

n = int(input())
ps = []
num = pf(n)
for i in num:
    if is_prime(i):
        ps.append(i)
        
zs = []        
for p in ps:
    z = p
    while(z<=n):
        zs.append(z)
        z *= p
zs.sort()

cnt = 0
for z in zs:
    if(n>1):
        if(n%z==0):
            n /= z
            cnt += 1
print(cnt)

Failing test case input:
1051373943064

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
import math

def is_prime(n):
    if n==1:
        return False
    nmax = int(math.sqrt(n)) + 1
    for i in range(2, nmax):
        if(n%i)==0:
            return False
    return True

def pf(n):
    sn = int(math.sqrt(n)) + 1
    ps = []
    for i in range(1, sn):
        if (n%i)==0:
            ps.append(i)
            ps.append(int(n/i))
    del ps[0]
    return ps        

n = int(input())
ps = []
num = pf(n)
for i in num:
    if is_prime(i):
        ps.append(i)
        
zs = []        
for p in ps:
    z = p
    while(z<=n):
        zs.append(z)
        z *= p
zs.sort()

cnt = 0
for z in zs:
    if(n>1):
        if(n%z==0):
            n /= z
            cnt += 1
print(cnt)

Problem: p02660
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a =int(input())
list = []
b = 1
for i in range(2,44):
    list.append(b)
    b = b + i
n = 0
e = 0
k = 0
for i in range(2,1000000):
    if (a % i == 0):
        warikaisi = True
        while(warikaisi):
            if a % i == 0:
                list.append(i)
                a = a / i
                e = e + 1
                if (e == list[k]):
                    n = n + 1
                    k = k + 1
            else:
                e = 0
                k = 0
                warikaisi = False
if (n == 0 and a != 1):
    n = 1
if (a >= 1000000):
    n = 1
print(n)

Failing test case input:
114304195595

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
a =int(input())
list = []
b = 1
for i in range(2,44):
    list.append(b)
    b = b + i
n = 0
e = 0
k = 0
for i in range(2,1000000):
    if (a % i == 0):
        warikaisi = True
        while(warikaisi):
            if a % i == 0:
                list.append(i)
                a = a / i
                e = e + 1
                if (e == list[k]):
                    n = n + 1
                    k = k + 1
            else:
                e = 0
                k = 0
                warikaisi = False
if (a >= 1000000):
    n = n + 1
print(n)
Problem: p02660
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
	import math
	N = int(input())
	if N==1:
		print(0)
	else:
		
		lst_e = []
		for p in range(2, math.ceil(math.sqrt(N))):
			e = 0
			while (N % p == 0):
				N /= p
				e += 1
			if e>0:
				lst_e.append(e)
		
		
		answer = 0
		for e in lst_e:
			i = 1
			while e >= i:
				e -= i
				i += 1
				answer += 1
		if answer == 0:
			answer = 1
		print(answer)
        
resolve()

Failing test case input:
44192863218

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
def resolve():
	answer = 0
	N = int(input())
	if N==1:
		print(answer)
	else:
		
		for p in range(2, int(N**0.5)+2):
			e = 0
			while (N % p == 0):
				N /= p
				e += 1
			
			if e>0:
				
				for i in range(1, e+1):
					if e >= i:
						e -= i
						answer += 1
		
		if N!=1:
			answer += 1
		print(answer)
        
resolve()

Problem: p02660
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
li=[0]*(10**6+1)
flag=False
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()
ans=0
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)
    
    

Failing test case input:
1130063570614

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
fn=N
li=[0]*(10**6+100)
flag=False
if N==1:
  print(0)
  exit()
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()

ans=0
if N>fn**0.5:
  ans+=1
  
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)

Problem: p02660
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from collections import Counter
n = int(input())
ans = 0
def primes(n):
    is_p = [True]*(n + 1)
    is_p[0] = False
    is_p[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_p[i]:
            continue
        for j in range(i*2, n+1, i):
            is_p[j] = False
    return [i for i in range(n+1) if is_p[i]]

p = primes(10**6)

dp = []
cl = []
n1 = n
for i in p:
    if n%i == 0:
        cl.append(i)
    while n%i == 0:
        n = n/i
        dp.append(i)
    if n == 1:
        break
if n == n1:
    dp.append(n)
    cl.append(n)

c = Counter(dp)

for i in cl:
    cnt = 1
    while c[i] >= cnt:
        c[i] -= cnt
        ans += 1
        cnt += 1
        
print(ans)


Failing test case input:
3246178996

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
from collections import Counter
n = int(input())
ans = 0

dp = []
cl = []
n1 = n
if n == 1:
    ans = 0
else:
    for i in range(2, int(n**0.5)+1):
        if n%i == 0:
            cl.append(i)
            while n%i == 0:
                n = n/i
                dp.append(i)
        if n == 1:
            break
    if n != 1:
        ans = 1

c = Counter(dp)

for i in cl:
    cnt = 1
    while c[i] >= cnt:
        c[i] -= cnt
        ans += 1
        cnt += 1
        
print(ans)
Problem: p02660
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
data = input()
target = int(data)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

list = primes(1000000)
result =[]
for i in list:
    check = target
    k = 0
    while True:
        if check % i != 0:
            break
        else:
            check = check/i
            k +=1
    result.append(k)

ans = 0
for j in result:
    y = 0
    z = j
    while z > y:
        y += 1
        z -= y
        ans +=1
if ans == 0 and target != 1:
    ans =1        
print(ans)

Failing test case input:
911738620

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
import math
data = input()
target = int(data)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

list = primes(2000000)
result =[]
for i in list:
    check = target
    k = 0
    while True:
        if check % i != 0:
            break
        else:
            check = check/i
            k +=1
    result.append(k)

ans = 0
for j in result:
    y = 0
    z = j
    while z > y:
        y += 1
        z -= y
        ans += 1


cover = 1
for i in range(len(list)):
    cover = cover*(list[i]**result[i])
if target/cover >2000000:
    ans +=1
print(ans)

Problem: p02660
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= math.ceil(math.sqrt(n))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

print(ans)

Failing test case input:
3688232787

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2

while(i <= math.ceil(math.sqrt(N))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1
    
else:
    yakusu.append(n)
    multi.append(1)

if(len(yakusu) == 0):
    print(1)
    exit()
    



ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

print(ans)
Problem: p02660
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(N):
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if divlist == [] and N >0:
    count = 1
print(count)

Failing test case input:
88143713752

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):

import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(Nsyo)+1:
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if N > math.sqrt(Nsyo):
    count = count + 1
print(count)
Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = [int(_) for _ in input().split()]
print('Yes' if a[0] == a[1] + a[2] else 'Yes' if a[1] == a[0] + a[2] else 'yes' if a[2] == a[0] + a[1] else 'No')

Failing test case input:
4 29 33

Expected output:
Yes


Actual output:
yes


Fixed submission (verdict: Accepted):
a = [int(_) for _ in input().split()]
print('Yes' if a[0] == a[1] + a[2] else 'Yes' if a[1] == a[0] + a[2] else 'Yes' if a[2] == a[0] + a[1] else 'No')

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    a, b, c = map(int, input().split() )

    if a == b + c | b == c + a | c == a + b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Failing test case input:
4 24 20

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    a, b, c = map(int, input().split() )

    if a == b + c or  b == c + a or c == a + b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l= list(map(int, input().split()))
l.sort()
if l[0] == l[1] + l[2]:
    print("Yes")
else:print("No")

Failing test case input:
10 30 20

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
l= list(map(int, input().split()))
l.sort()
if l[2] == l[1] + l[0]:
    print("Yes")
else:print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if a + b == c or a + c ==b or b + c == a:
  print("YES")
else:
  print("NO")

Failing test case input:
000 1 1

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if a + b == c or a + c ==b or b + c == a:
  print("Yes")
else:
  print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=sorted(list(map(int,input().split())))
print("Yes" if sum(A[:1])==A[2] else "No")

Failing test case input:
56 25 31

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
A=sorted(list(map(int,input().split())))
print("Yes" if sum(A[:2])==A[2] else "No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if a+b==c:
    print("Yes")
    exit()
if b+c==a:
    print("Yes")
if a+c==b:
    print("Yes")
print("No")


Failing test case input:
4 24 20

Expected output:
Yes


Actual output:
Yes
No


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if a+b==c:
    print("Yes")
    exit()
if b+c==a:
    print("Yes")
    exit()
if a+c==b:
    print("Yes")
    exit()
print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc = list(map(int, input().split()))
if abc[0]+abc[1] == abc[2]:
  print('Yes')
else:
  print('No')

Failing test case input:
10 30 20

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
abc = list(map(int, input().split()))
abc.sort()
if abc[0]+abc[1] == abc[2]:
  print('Yes')
else:
  print('No')
Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = [int(i) for i in input().split()] 
a.sort()
print(a[0])
c = a[0] + a[1]
if (a[2] == c):
  print("Yes")
else:
  print("No")

Failing test case input:
110 1 0

Expected output:
No


Actual output:
0
No


Fixed submission (verdict: Accepted):
a = [int(i) for i in input().split()] 
a.sort()
c = a[0] + a[1]
if (a[2] == c):
  print("Yes")
else:
  print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int,input().split()))
a.sort()
if (a[0] + a[1]) == a[2]:
  print("Yes")
else:
  print("NO")


Failing test case input:
24 25 31

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a = list(map(int,input().split()))
a.sort()
if (a[0] + a[1]) == a[2]:
  print("Yes")
else:
  print("No")

Problem: p03943
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=[int(i) for i in input().split()]
if a[0]==sum(a[1:]) or sum(a[:2])==a[2]:
  print("Yes")
else:
  print("No")

Failing test case input:
10 30 20

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
a=[int(i) for i in input().split()]
if a[0]==sum(a[1:]) or sum(a[:2])==a[2] or a[0]+a[2]==a[1]:
  print("Yes")
else:
  print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
if a[0]+a[1]==a[2]:
    print("YES")
else:
    print("NO")



Failing test case input:
001 -1 -5

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
a.sort()
if a[0]+a[1]==a[2]:
    print("Yes")
else:
    print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if abs(a-b)==c:print('Yes')
else:print('No')

Failing test case input:
4 29 33

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if abs(a-b)==c or abs(b-c) ==a:print('Yes')
else:print('No')

Problem: p03943
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
if a[0]+a[1]>a[2]:
  print('No')
else:
  print('Yes')


Failing test case input:
43 16 000

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
a.sort()
if a[0]+a[1]==a[2]:
  print('Yes')
else:
  print('No')

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
na = lambda: list(map(int, input().split()))
a, b, c = na()
if a + b == c or b + c == a:
    print("Yes")
else:
    print("No")

Failing test case input:
4 24 20

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
na = lambda: list(map(int, input().split()))
a, b, c = na()
if a + b == c or b + c == a or c + a == b:
    print("Yes")
else:
    print("No")
Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if (a+b+c)%2==0:
    print('Yes')
else:
    print('No')


Failing test case input:
001 0 -5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if max(a,b,c)==a+b+c-max(a,b,c):
    print('Yes')
else:
    print('No')

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print('YES' if a==(b+c) or b==(a+c) or c==(a+b) else 'NO')

Failing test case input:
16 2 49

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print('Yes' if a==(b+c) or b==(a+c) or c==(a+b) else 'No')

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=[int(i) for i in input().split()]
if a+b==c or b+c==a or c+a==b:
  print('YES')
else:
  print('NO')

Failing test case input:
24 25 31

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a,b,c=[int(i) for i in input().split()]
if (a+b)==c or (b+c)==a or (c+a)==b:
  print('Yes')
else:
  print('No')

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if a+b==c:
	print("YES")
elif b+c==a:
	print("YES")
elif a+c==b:
	print("YES")
else:
	print("NO")

Failing test case input:
6 16 101

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a+b==c:
	print("Yes")
elif b+c==a:
	print("Yes")
elif a+c==b:
	print("Yes")
else:
	print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())

if a+b == c or a+c == b or b+c ==a:
  print("yes")
else:
  print("no")
  

Failing test case input:
106 25 31

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())

if a+b == c or a+c == b or b+c ==a:
  print("Yes")
else:
  print("No")

Problem: p03943
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int,input().split())
print("YES" if (a+b) == c or (b+c) == a or (c+a) == b else "NO")

Failing test case input:
6 16 001

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a, b, c = map(int,input().split())
print("Yes" if (a+b) == c or (b+c) == a or (c+a) == b else "No")
Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			a=b
			b=c
			c=1
	else:
		c+=1
	maxhoge=max(maxhoge,a+b+c)





print(maxhoge)



Failing test case input:
10
0 1 1 3 2 8 4 7 8 7

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)

Problem: p03613
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
d = [0] * (10**5 + 2)
neg_count = 0
for i in range(len(a)):
  d[a[i] - 1] += 1
  d[a[i]] += 1
  d[a[i] + 1] += 1
ans = max(d)

Failing test case input:
7
3 1 2 1 5 9 0

Expected output:
4


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
d = [0] * (10**5 + 2)
neg_count = 0
for i in range(len(a)):
  d[a[i] - 1] += 1
  d[a[i]] += 1
  d[a[i] + 1] += 1
ans = max(d)
print(ans)

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(0)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	maxhoge=max(maxhoge,a+b+c)
	if(hoge[i]!=hoge[i+1]):
		a=b
		b=c
		c=1
	else:
		c+=1




print(maxhoge)



Failing test case input:
10
-1 2 1 5 8 4 8 4 17 0

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)
Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		a=b
		b=c
		c=1
	else:
		c+=1
	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)



Failing test case input:
10
0 1 1 5 5 2 8 7 14 2

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)

Problem: p03613
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n = ni()
A = lma()
l = max(A)
cnts = [0 for i in range(l+2)]
for a in A:
    cnts[a]+=1
    cnts[a-1] +=1
    cnts[a+1] +=1
print(max(cnts))


Failing test case input:
7
1 2 2 -1 1 1 1

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n = ni()
A = lma()
l = max(A)
cnts = [0 for i in range(l+3)]
for a in A:
    cnts[a]+=1
    cnts[a-1] +=1
    cnts[a+1] +=1
print(max(cnts))

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=int(input())
n_l=list(map(int,input().split()))
import collections
ans=0
n_l=collections.Counter(n_l)
for i in range(1,100001):
   ans=max(ans,n_l[i]+n_l[i+1]+n_l[i+2])
print(ans)

Failing test case input:
10
0 2 1 5 3 2 8 4 20 0

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
A=int(input())
n_l=list(map(int,input().split()))
import collections
ans=0
n_l=collections.Counter(n_l)
for i in range(0,100001):
   ans=max(ans,n_l[i]+n_l[i+1]+n_l[i+2])
print(ans)
Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		maxhoge=max(maxhoge,a+b+c)
		a=b
		b=c
		c=1
	else:
		c+=1
	if(i==n-1):
		maxhoge=max(maxhoge,a+b+c)




print(maxhoge)



Failing test case input:
7
1 1 2 -1 2 2 1

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N =  int(input())
    a = [int(i) for i in input().split()]
    
    
    
    count_ = [0] * ( max(a)+1 )
    
    
    
    
    
    for num in a:
        if(num-1 > 0):
            count_[num-1] += 1
            count_[num-2] += 1
            count_[num] += 1
        else:
            count_[num-1] += 1
            count_[num] += 1
    
    
    print(max(count_))
    
if __name__=="__main__":
    main()

Failing test case input:
7
3 2 2 -2 1 3 1

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
def main():
    N =  int(input())
    a = [int(i) for i in input().split()]
    
    
    
    count_ = [0] * ( max(a)+2 )
    
    
    
    
    
    for num in a:
        if(num > 0):
            count_[num-1] += 1
            count_[num] += 1
            count_[num+1] += 1
        else:
            count_[num] += 1
            count_[num+1] += 1
    
    
    print(max(count_))
    
if __name__=="__main__":
    main()

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			a=b
			b=c
			c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)



Failing test case input:
10
-1 2 1 5 8 4 8 4 20 0

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)
Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
num = [0 for i in range(max(a)+2)]
for i in a:
    num[i] += 1
temp = 0
ans = 0
for i in range(max(a)):
    temp = num[i] + num[i+1] + num[i+2]
    ans = max(temp, ans)
print(ans)

Failing test case input:
7
1 1 2 -1 2 2 1

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
num = [0 for i in range(max(a)+3)]
for i in a:
    num[i] += 1
ans = 0
for i in range(max(a)+1):
    temp = num[i] + num[i+1] + num[i+2]
    ans = max(temp, ans)
print(ans)

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		maxhoge=max(maxhoge,a+b+c)
		a=b
		b=c
		c=1
	else:
		c+=1




print(maxhoge)



Failing test case input:
10
0 1 1 3 2 8 4 7 8 7

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()
hoge.append(-1)
a=0
b=0
c=1
maxhoge=0
for i in range(0,n):
	if(hoge[i]!=hoge[i+1]):
		if(i!=n-1):
			if(hoge[i+1]-hoge[i]==1):
				a=b
				b=c
				c=1
			elif(hoge[i+1]-hoge[i]==2):
				a=c
				b=0
				c=1
			else:
				a=0
				b=0
				c=1
	else:
		c+=1


	maxhoge=max(maxhoge,a+b+c)




print(maxhoge)

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A).most_common()

a = B[0][0]
b = a + 1
c = a - 1

L = [a,b,c]
C = [0,0,0]

for i in range(N):
  for j in range(3):
    d = abs(A[i] - L[j])
    if d <= 1:
      C[j] += 1
    
print(max(C))

Failing test case input:
10
-1 1 2 1 4 8 6 7 8 4

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
import collections

N = int(input())
A = list(map(int,input().split()))

nums = []
roll = [-1,0,1]

for i in range(N):
  for j in range(3):
    d = A[i] + roll[j]
    nums.append(d)

num = collections.Counter(nums).most_common()
print(num[0][1])

Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N = int(input())
a = list(map(int, input().split()))

b = []

for ai in a:
    b.append(ai-1)
    b.append(ai)
    b.append(ai+1)


import collections
cnt = collections.Counter(b)

max(cnt.values())

Failing test case input:
10
-1 1 2 3 4 5 6 7 16 4

Expected output:
4


Actual output:

Fixed submission (verdict: Accepted):


N = int(input())
a = list(map(int, input().split()))

b = []

for ai in a:
    b.append(ai-1)
    b.append(ai)
    b.append(ai+1)


import collections
cnt = collections.Counter(b)

print(max(cnt.values()))
Problem: p03613
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
k = [0] * 100001
for a in map(int, input().split()):
    k[a] += 1
print(max(map(sum, zip(k[1:], k[2:], k[3:]))))


Failing test case input:
10
0 2 1 5 3 2 8 4 20 0

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
input()
k = [0] * 100000
for a in map(int, input().split()):
    k[a] += 1
print(max(map(sum, zip(k, k[1:], k[2:]))))

Problem: p03613
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    C = defaultdict(int)
    for a in A:
        C[a] += 1

    ans = 0
    for i in range(2, 10**5+1):
        ans = max(ans, C[i-1] + C[i] + C[i+1])
    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
10
0 1 0 3 5 2 4 7 14 2

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    C = defaultdict(int)
    for a in A:
        C[a] += 1

    ans = 0
    for i in range(10**5+1):
        ans = max(ans, C[i-1] + C[i] + C[i+1])
    print(ans)


if __name__ == '__main__':
    main()
Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mant = [0 for _ in range(N)]
for i in range(N):
    x, y = map(int, input().split())
    mant[i] = x + y

print(max(mant)-min(mant))

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

Expected output:
26


Actual output:
23


Fixed submission (verdict: Accepted):
n = int(input())
z = [0 for _ in range(n)]
w = [0 for _ in range(n)]

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

print(max(max(z)-min(z), max(w)-min(w)))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))

Failing test case input:
2
-5 2
-3 0

Expected output:
4


Actual output:
7


Fixed submission (verdict: Accepted):
from collections import deque
N = int(input())

AM, Am, BM, Bm = -1*10**9*2, 10**9*2, -1*10**9*2, 10**9*2
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))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
xy_array = [list(map(int, input().split())) for _ in range(n)]

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

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)

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

Expected output:
2


Actual output:
5


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

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

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(x - y, left_up_max)
    right_down_min = min(x - y, right_down_min)

ans = max(right_up_max - left_down_min, left_up_max - right_down_min)
print(ans)
Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
plus_max = 0
plus_min = 10**10
minus_max = 0
minus_min = 10**10
for _ in range(n):
    x, y = map(int, input().split())
    plus_max = max(plus_max, x + y)
    plus_min = min(plus_min, x + y)
    minus_max = max(minus_max, x - y)
    minus_min = min(minus_min, x - y)
print(max(plus_max - plus_min, minus_max - minus_min))


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

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
plus_max = 10**20 * -1
plus_min = 10**20
minus_max = 10**20 * -1
minus_min = 10**20
for _ in range(n):
    x, y = map(int, input().split())
    plus_max = max(plus_max, x + y)
    plus_min = min(plus_min, x + y)
    minus_max = max(minus_max, x - y)
    minus_min = min(minus_min, x - y)
print(max(plus_max - plus_min, minus_max - minus_min))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def f(x, y):
    return x-y, x+y


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

max_x = 0
min_x = 2000000000
max_y = 0
min_y = 2000000000
for xi, yi in p:
    x_, y_ = f(xi, yi)
    max_x = max(max_x, x_)
    min_x = min(min_x, x_)
    max_y = max(max_y, y_)
    min_y = min(min_y, y_)

print(max(max_x - min_x, max_y - min_y))

Failing test case input:
2
-2 1
-3 0

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
def f(x, y):
    return x-y, x+y


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

max_x = -2000000000
min_x = 2000000000
max_y = -2000000000
min_y = 2000000000
for xi, yi in p:
    f1, f2 = f(xi, yi)
    max_x = max(max_x, f1)
    min_x = min(min_x, f1)
    max_y = max(max_y, f2)
    min_y = min(min_y, f2)

print(max(max_x - min_x, max_y - min_y))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

max_f_0 = 0
min_f_0 = 10**10
max_f_1 = 0
min_f_1 = 10**10

for _ in range(N):
    x, y = map(int, input().split(" "))
    f_0 = x - y
    f_1 = x + y
    
    if max_f_0 < f_0:
        max_f_0 = f_0
    if min_f_0 > f_0:
        min_f_0 = f_0
    if max_f_1 < f_1:
        max_f_1 = f_1
    if min_f_1 > f_1:
        min_f_1 = f_1
        
print(max((max_f_0-min_f_0), (max_f_1-min_f_1)))
    

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

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())

max_f_0 = -10**10
min_f_0 = 10**10
max_f_1 = -10**10
min_f_1 = 10**10

for _ in range(N):
    x, y = map(int, input().split(" "))
    f_0 = x - y
    f_1 = x + y
    
    if max_f_0 < f_0:
        max_f_0 = f_0
    if min_f_0 > f_0:
        min_f_0 = f_0
    if max_f_1 < f_1:
        max_f_1 = f_1
    if min_f_1 > f_1:
        min_f_1 = f_1
        
print(max((max_f_0-min_f_0), (max_f_1-min_f_1)))
Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys


def main():
    N = int(sys.stdin.readline().rstrip())

    X = [None] * N
    Y = [None] * N 
    Z = [None] * N

    for i in range(N):
        x, y = map(int, sys.stdin.readline().rstrip().split())
        X[i] = x
        Y[i] = y
    
    X_min = min(X)
    Y_min = min(Y)

    for i in range(N):
        X[i] = X[i] - X_min
        Y[i] = Y[i] - Y_min
        Z[i] = X[i] + Y[i]

    print(max(Z) - min(Z))


main()

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

Expected output:
26


Actual output:
23


Fixed submission (verdict: Accepted):
import sys


def main():
    N = int(sys.stdin.readline().rstrip())

    X = [None] * N
    Y = [None] * N 
    Z = [None] * N

    for i in range(N):
        x, y = map(int, sys.stdin.readline().rstrip().split())
        X[i] = x
        Y[i] = y
    
    X_min = min(X)
    Y_min = min(Y)

    for i in range(N):
        X[i] = X[i] - X_min
        Y[i] = Y[i] - Y_min
        Z[i] = X[i] + Y[i]

    ans1 = max(Z) - min(Z)

    X_max = max(X)

    for i in range(N):
        X[i] = X_max - X[i]
        Y[i] = Y[i] - Y_min
        Z[i] = X[i] + Y[i]

    ans2 = max(Z) - min(Z)

    print(max(ans1, ans2))


main()

Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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))


Failing test case input:
2
-5 1
-3 0

Expected output:
3


Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
table = [[int(i) for i in input().split()] for N in range(N)]

a = -1
b = 10**10
c = -10**10
d = 10**10
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))

Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
z = []
zz = []
for _ in range(N):
    x, y = map(int, input().split())
    zz.append(x-y)
    z.append(x+y)
z.sort()
zz.sort()
ans = z[-1]-z[0]
ans = max(ans, zz[-1]+zz[0])

print(ans)

Failing test case input:
3
-3 -1
0 6
9 0

Expected output:
15


Actual output:
13


Fixed submission (verdict: Accepted):
N = int(input())
z = []
zz = []
for _ in range(N):
    x, y = map(int, input().split())
    zz.append(x-y)
    z.append(x+y)
z.sort()
zz.sort()
ans = z[-1]-z[0]
ans = max(ans, zz[-1]-zz[0])

print(ans)
Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())

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

def maxAbsValExpr(arr1, arr2):
    minX, maxX = min(arr1), max(arr1)
    minY, maxY = min(arr2), max(arr2)
    
    ans = 0
    
    for point in [(minX, minY), (maxX, minY), (minX, maxY), (maxX, maxY)]:
        minD = float('inf')
        maxD = float('-inf')
        for i in range(0, len(arr1)):
            distance = abs(arr1[i]-point[0]) + abs(arr2[i]-point[1]) + i
            minD = min(minD, distance)
            maxD = max(maxD, distance)
            ans = max(ans, maxD - minD)
    return ans


print(maxAbsValExpr(x, y)-1)



Failing test case input:
3
0 -2
0 0
11 2

Expected output:
15


Actual output:
16


Fixed submission (verdict: Accepted):
n=int(input())

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

def maxAbsValExpr(arr1, arr2):
    minX, maxX = min(arr1), max(arr1)
    minY, maxY = min(arr2), max(arr2)
    
    ans = 0
    
    for point in [(minX, minY), (maxX, minY), (minX, maxY), (maxX, maxY)]:
        minD = float('inf')
        maxD = float('-inf')
        for i in range(0, len(arr1)):
            distance = abs(arr1[i]-point[0]) + abs(arr2[i]-point[1]) 
            minD = min(minD, distance)
            maxD = max(maxD, distance)
            ans = max(ans, maxD - minD)
    return ans


print(maxAbsValExpr(x, y))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


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

Expected output:
30


Actual output:
29


Fixed submission (verdict: Accepted):
from sys import *
N = int(stdin.readline())
a,b = [],[]
for i in range(N):
    tmp = list(map(int, stdin.readline().split()))
    a.append(tmp[0] + tmp[1])
    b.append(tmp[0] - tmp[1])

a.sort()
b.sort()
print(max(a[-1]-a[0], b[-1]-b[0]))
Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from math import *
import fractions
import sys
import collections
import itertools
import pprint
from collections import deque
from heapq import *
import copy
N=int(input())
points=[list(map(int,input().split())) for _ in range(N)]


chebmax0=-float("inf")
chebmin0=float("inf")
chebmax1=-float("inf")
chebmin1=float("inf")


for l in points:
    chebmax0=max(chebmax0,l[0]-l[1])
for l in points:
    chebmin0=min(chebmax0,l[0]-l[1])
for l in points:
    chebmax1=max(chebmax1,l[0]+l[1])
for l in points:
    chebmin1=min(chebmax1,l[0]+l[1])

print(max(chebmax0-chebmin0,chebmax1-chebmin1))

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

Expected output:
25


Actual output:
0


Fixed submission (verdict: Accepted):
from math import *
import fractions
import sys
import collections
import itertools
import pprint
from collections import deque
from heapq import *
import copy
N=int(input())
points=[list(map(int,input().split())) for _ in range(N)]


chebmax0=-float("inf")
chebmin0=float("inf")
chebmax1=-float("inf")
chebmin1=float("inf")


for l in points:
    chebmax0=max(chebmax0,l[0]-l[1])
for l in points:
    chebmin0=min(chebmin0,l[0]-l[1])
for l in points:
    chebmax1=max(chebmax1,l[0]+l[1])
for l in points:
    chebmin1=min(chebmin1,l[0]+l[1])

print(max(chebmax0-chebmin0,chebmax1-chebmin1))

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)) 
my = (min(X) + max(X)) 

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)


Failing test case input:
2
0 -3
-1 1

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
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)) 
my = (min(Y) + max(Y)) 

Qx = []
Qy = []
for x, y in P:
    x, y = x-mx, y-my
    Qx.append(x+y)
    Qy.append(x-y)

ax = max(Qx) - min(Qx)
ay = max(Qy) - min(Qy)
ans = max(ax, ay)
print(ans)

Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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))

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

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
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 = min(YX_min,x-y)

print(max(XY_max-XY_min,YX_max-YX_min))
Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))


Failing test case input:
2
-5 2
-3 0

Expected output:
4


Actual output:
6


Fixed submission (verdict: Accepted):
n = int(input())
maxx, minx, maxy, miny = -10**10, 10**10, -10**10, 10**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))

Problem: p02556
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
arr=[]
s=set()
for _ in range(n):
	x,y=map(int,input().split())
	if((x,y) not in s):
		arr.append(x+y)
		s.add((x,y))
arr.sort()
if(len(arr)==1):
	print(0)
else:
	print(arr[-1]-arr[0])

Failing test case input:
3
1 2
1 4
3 1

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
arr=[]
arr2=[]
s=set()
for _ in range(n):
	x,y=map(int,input().split())
	if((x,y) not in s):
		arr.append(x+y)
		arr2.append(x-y)
		s.add((x,y))
arr.sort()
arr2.sort()
if(len(arr)==1):
	print(0)
else:
	ans=arr[-1]-arr[0]
	ans=max(ans,arr2[-1]-arr2[0])
	print(ans)

Problem: p02556
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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(abs(max(i)+max(j)), abs(min(i)+min(j))))


Failing test case input:
3
0 2
1 4
3 1

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
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)-min(i), max(j)-min(j)))
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 = 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 = b[0]-a[0]
        break
    if cnt >= n-1:
        break
    cnt += 1

print(max(ans1, ans2))


Failing test case input:
2
0 2
39 0

Expected output:
41


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))