Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
for i in range(n):
    c=b.remove(a[i])
    print(c[n//2-1])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[n//2]
d=b[n//2-1]
for i in range(n):
    print(c if a[i]<=d else d)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    b=sorted(a[:i]+a[i+1:])
    print(b[n//2-1])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[n//2]
d=b[n//2-1]
for i in range(n):
    print(c if a[i]<=d else d)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    b=sorted(del a[i])
    print(b[n//2-1])


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[n//2]
d=b[n//2-1]
for i in range(n):
    print(c if a[i]<=d else d)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    b=sorted(del a[i])
    print(b[n//2])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=b[n//2]
d=b[n//2-1]
for i in range(n):
    print(c if a[i]<=d else d)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
e=0
for i in [n//2-1,n//2]:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
        e=A
print(b,e)


Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
print(b,min(a,key=lambda x :abs(b-2*x)))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
for i in [n//2-1,n//2]:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
print(b,d)


Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
print(b,min(a,key=lambda x :abs(b-2*x)))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
d=0
for i in b:
    c=1
    A=a[i]
    for j in range(i+1)[A:i+1]:
        c*=j
    for k in range(1,A+1):
        c/=k
    if d < c:
        d=c
print(b,d)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
b=a.pop(-1)
print(b,min(a,key=lambda x :abs(b-2*x)))
Buggy python submission (verdict: Runtime Error):
s = set(list(int(input())))
if s == {'a','b','c'}:
    print('Yes')
else:
  print('No')

Fixed submission:
s = set(list(input()))
if s == {'a','b','c'}:
    print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s = set(list(int(input())))
if s = {'a','b','c'}:
    print('Yes')
else:
  print('No')

Fixed submission:
s = set(list(input()))
if s == {'a','b','c'}:
    print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]

for i in range(n):
    d = a[i+1]
    del(a[i+1])
    c = 0
    for j in range(1,n+1):
        c += abs(a[j]-a[j-1])
    print(c)
    a.insert(i+1,d)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]
s = 0

for i in range(1,n+2):
    s += abs(a[i]-a[i-1])

for i in range(1,n+1):
    print(s-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]

for i in range(n):
    d = a[i+1]
    del(a[i+1])
    c = 0
    for j in range(n+1)[1:n+1]:
        c += abs(a[j]-a[j-1])
    print(c)
    a.insert(i+1,d)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = [0] + a +[0]
s = 0

for i in range(1,n+2):
    s += abs(a[i]-a[i-1])

for i in range(1,n+1):
    print(s-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
x = list(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(x[i])-t.count(x[i])
print(max(a))

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
a=[0]*(L+1)
for i in L:
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))


Fixed submission:
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
x = list(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(x[i])-t.count(x[i])
print(max(a))

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s)
L=len(S)
a=[0]*(L+1)
for i in L:
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
x = list(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(x[i])-t.count(x[i])
print(max(a))
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
[a,b] = [a,b].sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
a,b = list(a,b).sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
a = list(input().split())
b = list(input().split())
c = list(input().split())

print(a[0]+b[1]+c[2])

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
a = list( map(input().split()))
b = list( map(input().split()))
c = list( map(input().split()))

print(a[0]+b[1]+c[2])

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])

Buggy python submission (verdict: Runtime Error):
a = list( map(input().split()))
b = list( map(input().split()))
c = list( map(input().split()))

print(a[0],b[1],c[2])

Fixed submission:
a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
[a,b] = [a,b].sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))


Fixed submission:
a, b = map(int,input().split())
c = [a,b]
c.sort()
if c[0] == 1:
    if c[1]==1:
        print(1)
    else:
        print(c[1]-2)
else:
    print((c[0]-2) * (c[1]-2))

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
list(c) = [a,b]
c =  c.sort()
if a == 1:
    if b==1:
        print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Fixed submission:
a, b = map(int,input().split())
c = [a,b]
c.sort()
if c[0] == 1:
    if c[1]==1:
        print(1)
    else:
        print(c[1]-2)
else:
    print((c[0]-2) * (c[1]-2))

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if a == 1:
    if b==1:
    print(b)
    else:
        print(b-2)
else:
    print((a-2) * (b-2))

Fixed submission:
a, b = map(int,input().split())
c = [a,b]
c.sort()
if c[0] == 1:
    if c[1]==1:
        print(1)
    else:
        print(c[1]-2)
else:
    print((c[0]-2) * (c[1]-2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    s=input()
    if s[0]=='M':
        m+=1
    elif s[0]=='A':
        a+=1
    elif s[0]=='R':
        r+=1
    elif s[0]=='C':
        c+=1
    elif s[0]=='H':
        h+=1
x=del ([m,a,r,c,h],0)
x.sort()
l=len(x)
if l<3:
    print(0)
elif l==3:
    print(x[0]*x[1]*x[2])
elif l==4:
    print()
else:
    print()

Fixed submission:
n=int(input())
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    s=input()
    if s[0]=='M':
        m+=1
    elif s[0]=='A':
        a+=1
    elif s[0]=='R':
        r+=1
    elif s[0]=='C':
        c+=1
    elif s[0]=='H':
        h+=1
x=[m,a,r,c,h]
cnt=x.count(0)
for i in range(cnt):
    x.remove(0)

l=len(x)
if l<3:
    print(0)
elif l==3:
    print(x[0]*x[1]*x[2])
elif l==4:
    a,b,c,d=x[0],x[1],x[2],x[3]
    print(a*b*c+a*b*d+a*c*d+b*c*d)
else:
    a,b,c,d,e=x[0],x[1],x[2],x[3],x[4]
    print(a*b*c+a*b*d+a*c*d+b*c*d\
         +e*a*b+e*a*c+e*a*d+e*b*c+e*b*d\
         +e*c*d)
Buggy python submission (verdict: Runtime Error):
n= int(input())
a = list(map(int,input().split()))
c = 0

a.sort()[::-1]

for i in range(n):
    c = c + ((-1)**(i%2))*c[i]

print(c)

Fixed submission:
n= int(input())
a = list(map(int,input().split()))
c = 0

a.sort()
a = a[::-1]
for i in range(n):
    c = c + ((-1)**(i%2))*a[i]

print(c)
Buggy python submission (verdict: Runtime Error):
c = [[map(int,input().split())] for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Fixed submission:
c = [list(map(int,input().split())) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][0],\
c[2][0]-c[0][0],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
c = [map(int,input().split()) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][1],\
c[2][0]-c[0][2],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')

Fixed submission:
c = [list(map(int,input().split())) for i in range(3)]
a1,a2,a3,b1,b2,b3 = 0,c[1][0]-c[0][0],\
c[2][0]-c[0][0],c[0][0],c[0][1],c[0][2]

if c[1][1]==a2+b2 and c[1][2]==a2+b3 and\
c[2][1]==a3+b2 and c[2][2]==a3+b3:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x=int(input())
a=int(input())
b=ibt(input())

print((x-a)%b)

Fixed submission:
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a%2=1) and (b%2=1):
    print('Odd')
else:
    print('Even')

Fixed submission:
a,b=map(int,input().split())
if (a%2==1) and (b%2==1):
    print('Odd')
else:
    print('Even')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%2=1 and b%2=1:
    print('Odd')
else:
    print('Even')

Fixed submission:
a,b=map(int,input().split())
if (a%2==1) and (b%2==1):
    print('Odd')
else:
    print('Even')
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n):
    d += int(input())

print(len(d))

Fixed submission:
n = int(input())
d = [input() for i in range(n)]

print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
y //= 1000
a,b,c = 0,0,0

for i in range(n):
    for j in range(n-j):
        if 10*i + 5*j + (n-i-j) == y:
            print(i,j,n-i-j)
            exit()
print('-1 -1 -1')

Fixed submission:
n,y = map(int,input().split())
y //= 1000

for i in range(n+1):
    for j in range(n-i+1):
        if 10*i + 5*j + (n-i-j) == y:
            print(i,j,n-i-j)
            exit()
print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
n = int(input())
c,s,f = [0]*n,[0]*n,[0]*n
for i in range(n-1):
    c[i],s[i],f[i] = map(int,input().split())
for i in range(n):
    cnt = 0
    j = i
    while j < n-1:
        if cnt <= s[j]:
            cnt += s[j]+c[j]
        else:
            cnt = s[j]+(cnt - s[j])//f[j]+[0,1]((cnt - s[j])%f[j])+c[j]
        j += 1
    print(cnt)

Fixed submission:
n = int(input())
c,s,f = [0]*n,[0]*n,[0]*n
for i in range(n-1):
    c[i],s[i],f[i] = map(int,input().split())
for i in range(n):
    cnt = 0
    j = i
    while j < n-1:
        if cnt <= s[j]:
            cnt = s[j]+c[j]
        else:
            cnt = s[j]+f[j]*((cnt - s[j])//f[j])+\
            [f[j],0][((cnt - s[j])%f[j])==0]+c[j]
        j += 1
    print(cnt)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
cnt = Counter(a)

c = 0
for k,v in c.items():
    if v >= k:
        c += v-k
    else:
        c += v
print(c)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
cnt = Counter(a)

c = 0
for k,v in cnt.items():
    if v >= k:
        c += v-k
    else:
        c += v
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

cnt = 0

b = set(a)

for i in b:
    c = a.count(i)
    if c > i:
        cnt += c - i
    elif c == i:
        continue
    else:
        cnt += c

print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
cnt = Counter(a)

c = 0
for k,v in cnt.items():
    if v >= k:
        c += v-k
    else:
        c += v
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

cnt = 0

b = set(a)

for i in b:
    if a.count(i) > i:
        cnt += a.count(i) - i
    elif a.count(i) == i:
        continue
    else:
        cnt += a.count(i)

print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
cnt = Counter(a)

c = 0
for k,v in cnt.items():
    if v >= k:
        c += v-k
    else:
        c += v
print(c)
Buggy python submission (verdict: Runtime Error):
n = input()
t = sum(map(int,n))

if (t // n) == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = input()
t = sum(map(int,n))

if (int(n)%t) == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A = input()
a,b,c,d = A[0],A[1],A[2],A[3]
e1 = a+b+c+d
e2 = a+b+c-d
e3 = a+b-c+d
e4 = a+b-c-d
e5 = a-b+c+d
e6 = a-b+c-d
e7 = a-b-c+d
e8 = a-b+c-d
if eval(e1) == 7:
    print(e1)
elif eval(e2) == 7:
    print(e2)
elif eval(e3) == 7:
    print(e3)
elif eval(e4) == 7:
    print(e4)
elif eval(e5) == 7:
    print(e5)
elif eval(e6) == 7:
    print(e6)
elif eval(e7) == 7:
    print(e7)
elif eval(e8) == 7:
    print(e8)

Fixed submission:
A = input()
a,b,c,d = A[0],A[1],A[2],A[3]
e1 = a+'+'+b+'+'+c+'+'+d
e2 = a+'+'+b+'+'+c+'-'+d
e3 = a+'+'+b+'-'+c+'+'+d
e4 = a+'+'+b+'-'+c+'-'+d
e5 = a+'-'+b+'+'+c+'+'+d
e6 = a+'-'+b+'+'+c+'-'+d
e7 = a+'-'+b+'-'+c+'+'+d
e8 = a+'-'+b+'+'+c+'-'+d
if eval(e1) == 7:
    print(e1+'=7')
elif eval(e2) == 7:
    print(e2+'=7')
elif eval(e3) == 7:
    print(e3+'=7')
elif eval(e4) == 7:
    print(e4+'=7')
elif eval(e5) == 7:
    print(e5+'=7')
elif eval(e6) == 7:
    print(e6+'=7')
elif eval(e7) == 7:
    print(e7+'=7')
elif eval(e8) == 7:
    print(e8+'=7')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int,input().split())))
b = sorted(list(map(int,input().split())))
c = sorted(list(map(int,input().split())))

cnt = 0

for i in range(len(a)):
    A = a[i]
    j = 0
    while j < len(b):
        if A < b[j]:
            cnt += 1
            j += 1
            k = 0
            while k < len(c):
                if b[j] > c[k]:
                    cnt += 1
                    k += 1
        else:
            break
print(cnt)

Fixed submission:
from bisect import *

n = int(input())
a,b,c = [sorted(map(int,input().split())) for i in range(3)]

print(sum([bisect_left(a,i)*(n-bisect_right(c,i)) for i in b]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int,input().split())))
b = sorted(list(map(int,input().split())))
c = sorted(list(map(int,input().split())))

cnt = 0

for i in range(len(a)):
    A = a[i]
    j = 0
    while j < len(b):
        if A < b[j]:
            cnt += 1
            j += 1
        else:
            break
		while k < len(c):
           if b > c:
               cnt += 1
print(cnt)


Fixed submission:
from bisect import *

n = int(input())
a,b,c = [sorted(map(int,input().split())) for i in range(3)]

print(sum([bisect_left(a,i)*(n-bisect_right(c,i)) for i in b]))
Buggy python submission (verdict: Runtime Error):
r = int(input())
g = int(input())

print(2g-r)


Fixed submission:
r = int(input())
g = int(input())

print(2*g-r)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(jnt,input().split())
if a==b:
    print(c)
elif b==c:
    print(a)
else:
    print(b)


Fixed submission:
a,b,c=map(int,input().split())
if a==b:
    print(c)
elif b==c:
    print(a)
else:
    print(b)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(jnt,input().split())
if a=b:
    print(c)
elif b=c:
    print(a)
else:
    print(b)

Fixed submission:
a,b,c=map(int,input().split())
if a==b:
    print(c)
elif b==c:
    print(a)
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
print(sum(list(input())))

Fixed submission:
print(sum(map(int,list(input()))))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())
y=max(a)
print(y+b[y])

Fixed submission:
n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())
y=max(a)
print(y+b[a.index(y)])
Buggy python submission (verdict: Runtime Error):
n=int(input())
c=0
for i in range(n):
    x,y=input().split()
    c+=y-x+1
print(c)

Fixed submission:
n=int(input())
c=0
for i in range(n):
    x,y=map(int,input().split())
    c+=y-x+1
print(c)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=set()
for i in range(n):
    s^=set(int(input()))
print(len(s))


Fixed submission:
n=int(input())
s=set()
for i in range(n):
    s ^= {input()}
print(len(s))

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=set()
for i in range(n):
    s^=int(input())
print(len(s))


Fixed submission:
n=int(input())
s=set()
for i in range(n):
    s ^= {input()}
print(len(s))

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=set()
for i in range(n):
    s^=input()
print(s)


Fixed submission:
n=int(input())
s=set()
for i in range(n):
    s ^= {input()}
print(len(s))

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=set()
for i in range(n):
    s^=int(input())
print(s)

Fixed submission:
n=int(input())
s=set()
for i in range(n):
    s ^= {input()}
print(len(s))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

d = [0]*(max(a)+3)
s = set(a)
for i in s:
    c = a.count(i)
    d[i+1] += c
    d[i] += c
    d[i+2] += c

print(max(d))

Fixed submission:
cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

d = [0]*(max(a)+3)

for i in range(0,max(a)+1):
    c = a.count(i)
    d[i+1] += c
    d[i] += c
    d[i+2] += c

print(max(d))

Fixed submission:
cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
cnt=[0]*100002;input()
for x in map(int,input().split()):cnt[x]+=1;cnt[x+1]+=1;cnt[x+2]+=1
print(max(cnt))
#I understood

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

d = [0]*(max(a)+3)

for i in range(0,max(a)+1):
    c = a.count(i)
    d[i+1] += c
    d[i] += c
    d[i+2] += c

print(max(d))

Fixed submission:
cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

m = 0
s = sorted(a)

d = [0]*(s[-1]+3)

for i in range(0,s[-1]+1):
    d[i+1] += s.count(i)
    d[i] += s.count(i)
    d[i+2] += s.count(i)

print(max(d))


Fixed submission:
cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

m = 0
s = sorted(a)

d = [0]*(s[-1]+3)

for i in range(0,s[-1]+1):
    d[i+1] = s.count(i)
e = [0]*(s[-1]+3)
for i in range(0,s[-1]+1):
    e[i] = d[i]+d[i+1]+d[i+2]

print(max(e))

Fixed submission:
cnt=[0]*100002
input()
for x in map(int,input().split()):
    cnt[x]+=1
    cnt[x+1]+=1
    cnt[x+2]+=1
print(max(cnt))
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b)
    print('A')
else:
    print('B')

Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
    print('A')
else:
    print('B')