Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
count = [0]*2000
A = (10**9)+7
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  c_out += sum(count[:a[i]-1])
N = (c_in*k)%A + (k*(k-1)//2)*c_out%A
print(N)

Fixed submission:
m,d = map(int, input().split(' '))
mlist = list(range(m+1))
c = 0
for _d in range(d+1):
	d1 = _d // 10
	d0 = _d % 10
	if d1 > 1 and d0 > 1 and d1*d0 in mlist:
		c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
A = (10**9)+7
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  for j, t in enumerate(a):
    c_out += int(t > a[i])
N = (k*c_in)%A + ((k*(k-1)//2)*c_out)%A
print(int(N))


Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in range(n):
    for j in range(i+1,n):
        if a[i]>a[j]:
            x+=1
y=0
for i in range(n):
    for j in range(n):
        if a[i]>a[j]:
            y+=1
cnt=(x*k)+(k*(k-1)//2*y)
print(cnt%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
amax = max(a)
count = [0]*2000
c_in = 0
for i in range(n):
  for j, t in enumerate(a[:i]):
    c_in += int(t > a[i])
    if t > a[i]:
  count[a[i]-1] += 1
c_out = 0
for i in range(n):
  c_out += sum(count[:a[i]-1])
res = int(c_in*k + c_out*k*(k-1)/2)
print(res%(10**9+7))

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in range(n):
    for j in range(i+1,n):
        if a[i]>a[j]:
            x+=1
y=0
for i in range(n):
    for j in range(n):
        if a[i]>a[j]:
            y+=1
cnt=(x*k)+(k*(k-1)//2*y)
print(cnt%(10**9+7))
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split()

x = max([A + B, A - B, A * B])

print(x)



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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reverse)
print(aaa[0])



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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reseve)
print(aaa[0])



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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)

Buggy python submission (verdict: Runtime Error):
a = int(input().split())

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x > y and x > z:
  print('x')
elif y > x and y > z:
  print('y')
else:
  print('z')
  
  

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

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
else:
  print(z)
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split(" ")))
D=[0]*N
M=[0]*N

D[N-1]=H[N-1]
M[N-1]=1
for i in reversed(range(N-1)):
  if H[i] > H[i-1]:
    D[i]=D[i-1]+1
  else:
    D[i]=1
  M[i]=max(D[i],M[i-1])
return M[0]

Fixed submission:
N=int(input())
H=list(map(int,input().split(" ")))
D=[0]*N
M=[0]*N
D[N-1]=0
M[N-1]=0
for i in reversed(range(N-1)):  
  if H[i] >= H[i+1]:
    D[i]=D[i+1]+1
  else:
    D[i]=0
  M[i]=max(D[i],M[i+1])
#print(H)
#print(D)
#print(M)
print(M[0])
Buggy python submission (verdict: Runtime Error):
print s if int(raw_input()) >= 3200 else "red" 

Fixed submission:
n = int(raw_input())
s = raw_input().rstrip()
print s if n >= 3200 else "red"
Buggy python submission (verdict: Runtime Error):
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) % A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p<n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main1()

Fixed submission:
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) - A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p <= n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main2()
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
m=A+B
print(min(A, B), max(0,m-N))

Fixed submission:
N, A, B = map(int, raw_input().split())
m=A+B
print min(A, B), max(0,m-N)

Buggy python submission (verdict: Runtime Error):
import sys
file= lambda location: {True:sys.stdin, False:open(location,"r")}[location==""]

location="subs.txt"#Enter location here
sys.stdin=file(location)
raw_input=sys.stdin.readline

for i in xrange(int(raw_input())):
N,A,B=map(int,raw_input().split())
m=A+B
if A==B==N:
	print N,N
elif(m>N):
	if A==B:
		print A,1
	else:
		print min(A,B),abs(A-B)
else:
	print min(A,B),0




Fixed submission:
N, A, B = map(int, raw_input().split())
m=A+B
print min(A, B), max(0,m-N)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,raw_input().split())
it(a>b): print(a-1)
else: print a

Fixed submission:
#for i in xrange(15):
a,b=map(int,raw_input().split())
if(a>b): print "%d"%(a-1)
else: print "%d"%(a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for i in range(0, 101):
	for j in range(0,101):
		h = a[0][0] + abs(i - a[0][2]) + abs(j - a[0][1])
		for k in range(n):
			d = h - abs(i - a[k][2]) - abs(j - a[k][1])
			if (d >= 0 and d != a[k][0]) or (d < 0 and a[k][0] != 0):
				break
			if k == n - 1:
				b.append(i)
				b.append(j)
				b.append(h)
print(b[0], b[1], b[2])

Fixed submission:
n = int(input())
a = []
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for x in range(101):
	for y in range(101):
		h = a[n - 1][0] + abs(x - a[n - 1][2]) + abs(y - a[n - 1][1])
		for k in range(n):
			d = h - abs(x - a[k][2]) - abs(y - a[k][1])
			if a[k][0] != max(d, 0):
				break
			if k == n - 1:
				print(x, y, h)
				exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for i in range(0, 101):
	if flag == 1:
		break
	for j in range(0,101):
		if flag == 1:
			break
		h = a[0][0] + abs(i - a[0][2]) + abs(j - a[0][1])
		for k in range(n):
			d = h - abs(i - a[k][2]) - abs(j - a[k][1])
			if (d >= 0 and d != a[k][0]) or (d < 0 and a[k][0] != 0):
				break
			if k == n - 1:
				b.append(i)
				b.append(j)
				b.append(h)
				flag = 1
print(b[0], b[1], b[2])

Fixed submission:
n = int(input())
a = []
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for x in range(101):
	for y in range(101):
		h = a[n - 1][0] + abs(x - a[n - 1][2]) + abs(y - a[n - 1][1])
		for k in range(n):
			d = h - abs(x - a[k][2]) - abs(y - a[k][1])
			if a[k][0] != max(d, 0):
				break
			if k == n - 1:
				print(x, y, h)
				exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for i in range(0, 101):
	if flag == 1:
		break
	for j in range(0,101):
		if flag == 1:
			break
		h = a[0][0] + abs(i - a[0][2]) + abs(j - a[0][1])
		for k in range(n):
			d = h - abs(i - a[k][2]) - abs(j - a[k][1])
			if (d >= 0 and d != a[k][0]) or (d < 0 and a[k][0] == 0):
				break
			if k == n - 1:
				b.append(i)
				b.append(j)
				b.append(h)
				flag = 1
print(b[0], b[1], b[2])

Fixed submission:
n = int(input())
a = []
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for x in range(101):
	for y in range(101):
		h = a[n - 1][0] + abs(x - a[n - 1][2]) + abs(y - a[n - 1][1])
		for k in range(n):
			d = h - abs(x - a[k][2]) - abs(y - a[k][1])
			if a[k][0] != max(d, 0):
				break
			if k == n - 1:
				print(x, y, h)
				exit()
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, x, y = map(int, input().split())
d = x * 2
e = y * 2

num = int(a * x + b * y)
count = 0
for i in range(x + 1):
	for j in range(y + 1):
		k = 0
		m = d - 2 * i
		n = e - 2 * j
		if m >= n:
			k = m
		else:
			k = n
		count = int(i * a + j * b + k * c)
		if num > count:
			num = count

print(num)

Fixed submission:
a, b, c, x, y = map(int, input().split())
count = 0

if x >= y:
	i = a * (x - y) + c * y * 2
	j = a * x + b * y
	k = c * x * 2
	if i >= j and k >= j:
		count = j
	elif i >= k and j >= k:
		count = k
	elif j >= i and k >= i:
		count = i
else:
	i = b * (y - x) + c * x * 2
	j = a * x + b * y
	k = c * y * 2
	if i >= j and k >= j:
		count = j
	elif i >= k and j >= k:
		count = k
	elif j >= i and k >= i:
		count = i

print(count)
Buggy python submission (verdict: Runtime Error):
    l = list(map(int, input().split()))
     
    if l[0]<2 or l[0]>20 or l[1]<1 or l[1]>20:
    	sys.exit()
     
    a = 0
    while l[0] <= l[1]:
    	l[1] = l[1] - l[0]
    	a += 1
    print(a)

Fixed submission:
S=input()
T=input()
if len(S)>3 or len(S) < 1 or len(T)>3 or len(T) < 1:
  sys.exit()

a = 0
if S[0] == T[0]:
  a += 1
if S[1] == T[1]:
  a += 1
if S[2] == T[2]:
  a += 1

print(a)

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))

if l[0]<2 or l[0]>20 or l[1]<1 or l[1]>20:
	sys.exit()


a = 1
while l[0] < l[1]:
	l[1] = l[1] - l[0]
	a += 1
print(a)

Fixed submission:
S=input()
T=input()
if len(S)>3 or len(S) < 1 or len(T)>3 or len(T) < 1:
  sys.exit()

a = 0
if S[0] == T[0]:
  a += 1
if S[1] == T[1]:
  a += 1
if S[2] == T[2]:
  a += 1

print(a)

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))

if l[0]<2 or l[0]>20 or l[1]<1 or l[1]>20:
	sys.exit()

a = 0
while l[0] <= l[1]:
	l[1] = l[1] - l[0]
	a += 1
print(a)

Fixed submission:
S=input()
T=input()
if len(S)>3 or len(S) < 1 or len(T)>3 or len(T) < 1:
  sys.exit()

a = 0
if S[0] == T[0]:
  a += 1
if S[1] == T[1]:
  a += 1
if S[2] == T[2]:
  a += 1

print(a)
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))

if A<2 or A>20 or B<1 or B>20:
	sys.exit()

if B == 1:
	print(0)
	sys.exit()

a = 1
while A < B:
	B = B - A
	a += 1
print(a)

Fixed submission:
A, B = list(map(int, input().split()))

if A<2 or A>20 or B<1 or B>20:
	exit()

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

a = 1
while A < B:
	B = B - A + 1 
	a += 1
print(a)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
S[K-1] += 32
print(S)

Fixed submission:
N, K = list(map(int, input().split()))
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

S = S.split()
T = T.split()

count = 0
for i in range(3):
  if S[i]==T[i]:
    count+=1
print count

Fixed submission:
S = list(input())
T = list(input())

count = 0
for i in range(3):
    if S[i] == T[i]:
        count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
a = [input().split() for l in range(2)]
count = 0
if a[0][0] == a[1][0]:
  count = count + 1
if a[0][1] == a[1][1]:
  count = count + 1
if a[2][0] == a[2][0]:
  count = count + 1
 
print(count)

Fixed submission:
a = [input().split() for l in range(2)]
forecast = list(str(a[0]))
real = list(str(a[1]))
count = 0
if forecast[2] == real[2]:
  count = count + 1
if forecast[3] == real[3]:
  count = count + 1
if forecast[4] == real[4]:
  count = count + 1
 
print(str(count))

Buggy python submission (verdict: Runtime Error):
a = [input().split() for l in range(3)]
count = 0
if a[0][0] == a[1][0]:
  count = count + 1
if a[0][1] == a[1][1]:
  count = count + 1
if a[2][0] == a[2][0]:
  count = count + 1

print(count)

Fixed submission:
a = [input().split() for l in range(2)]
forecast = list(str(a[0]))
real = list(str(a[1]))
count = 0
if forecast[2] == real[2]:
  count = count + 1
if forecast[3] == real[3]:
  count = count + 1
if forecast[4] == real[4]:
  count = count + 1
 
print(str(count))
Buggy python submission (verdict: Runtime Error):
a = [input().split() for l in range(1)]
tap = a[0]
need = a[1]
count = 1
needed_tap = 0
while count < need:
  count = count + (tap - 1)
  needed_tap = needed_tap +1

print(str(needed_tap))


Fixed submission:
i = list(map(int, input().split()))

tap = int(i[0])
need = int(i[1])
count = 1
needed_tap = 0
while count < need:
  count = count + (tap - 1)
  needed_tap = needed_tap +1
 
print(str(needed_tap))
Buggy python submission (verdict: Runtime Error):
A,B=input().split()

if (int(A)+int(B))%2 == 1:
    print(IMPOSSIBLE)
else:
    print(int((int(A)+int(B))/2))


Fixed submission:
A,B=input().split()

if (int(A)+int(B))%2 == 1:
    print("IMPOSSIBLE")
else:
    print(int((int(A)+int(B))/2))
Buggy python submission (verdict: Time Limit Exceeded):
L,R=input().split()

mod=2019

for i in range(int(L),int(R)):
    for j in range(int(i)+1,int(R)+1):
        result=(i*j)%2019
        if mod>result :
            mod=result

print(mod)


Fixed submission:
L,R=input().split()

mod=2019

for i in range(int(L),int(R)):
    for j in range(int(i)+1,int(R)+1):
        result=(i*j)%2019
        if mod>result :
            mod=result
        if mod == 0:
            break
    if mod == 0:
        break

print(mod)
Buggy python submission (verdict: Runtime Error):
N=input()
d=list(map(int, input().strip().split()))
ans=0

for i in range(int(max(d)+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


Fixed submission:
S = input()


list_S=list(S)

if list_S[0]==list_S[1] and list_S[2]==list_S[3] and list_S[0] != list_S[2]:
    print("Yes")
elif list_S[0]==list_S[2] and list_S[1]==list_S[3] and list_S[0] != list_S[1]:
    print("Yes")
elif list_S[0]==list_S[3] and list_S[1]==list_S[2] and list_S[0] != list_S[1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


Fixed submission:
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

#for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):

print(int(d[int(N/2)])-int(d[int(N/2)-1]))

Buggy python submission (verdict: Time Limit Exceeded):
import math

N=int(input())
d=list(map(int, input().strip().split()))
ans=0

ave_d=sum(d)/N

diff=[]

for num1 in d:
    diff.append(num1-ave_d)

diff2=[]

for num2 in diff:
    diff2.append(num2**2)

dis_d=sum(diff2)/N

std_d=math.sqrt(dis_d)

for i in range(int(ave_d-std_d),int(ave_d+std_d+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


Fixed submission:
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

#for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):

print(int(d[int(N/2)])-int(d[int(N/2)-1]))

Buggy python submission (verdict: Time Limit Exceeded):
N=input()
d=list(map(int, input().strip().split()))
ans=0

for i in range(int(max(d)+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


Fixed submission:
N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

#for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):

print(int(d[int(N/2)])-int(d[int(N/2)-1]))
Buggy python submission (verdict: Runtime Error):
a, b = [int(c) for c in input().split(' ')]
num = 0
bdash = b
if b == 1:
    num = 0
    bdash = -1
while bdash > 0:
    if bdash == a:
        num = num+1
        break
    elif bdash > a:
        num = num+1
        bdash = bdash - (a - 1)
    elif bdash < a:
        num = num + 1
        break
print(num)


Fixed submission:
s = input()
t = input()
m = 0
for i in range(len(s)):
    if s[i] == t[i]:
        m+=1
print(m)
Buggy python submission (verdict: Runtime Error):
c = []
for i in range(3):
    c.append([int(c) for c in input().split(' ')])
result = 'No'
for a1 in range(0, 101):
    for a2 in range(0, 101):
        for a3 in range(0, 101):
            if ((a1 - a2 == c[0][0]+c[0][1]+c[0][2]
            - c[1][0]- c[1][1] - c[1][2])
             and (a1-a3 == c[0][0]+c[0][1]+c[0][2]
             -c[2][0]- c[2][1] - c[2][2])
             and (a2 - a3 == c[1][0]+ c[1][1] + c[1][2]
             - c[2][0] - c[2][1] - c[2][2]
             )):
                result = 'Yes'
                break
print(result)

Fixed submission:
n = int(input())
a = int(input())

rest = n % 500
if rest <= a :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
c = []
for i in range(3):
    c.append([int(c) for c in input().split(' ')])
result = 'No'
for a1 in range(0, 101):
    for a2 in range(0, 101):
        for a3 in range(0, 101):
            if ((a1 - a2 == c[0][0]+c[0][1]+c[0][2]
            - c[1][0]- c[1][1] - c[1][2])
             and (a1-a3 == c[0][0]+c[0][1]+c[0][2]
             -c[2][0]- c[2][1] - c[2][2])
             and (a2 - a3 == c[1][0]+ c[1][1] + c[1][2]
             - c[2][0] - c[2][1] - c[2][2]
             )):
                result = 'Yes'
                break
            else:
              continue
                  
print(result)

Fixed submission:
n = int(input())
a = int(input())

rest = n % 500
if rest <= a :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
c = []
for i in range(3):
    c.append([int(c) for c in input().split(' ')])
result = 'No'
for a1 in range(0, 201):
    for a2 in range(0, 201):
        for a3 in range(0, 201):
            if ((a1 - a2 == c[0][0]+c[0][1]+c[0][2]
            - c[1][0]- c[1][1] - c[1][2])
             and (a1-a3 == c[0][0]+c[0][1]+c[0][2]
             -c[2][0]- c[2][1] - c[2][2])
             and (a2 - a3 == c[1][0]+ c[1][1] + c[1][2]
             - c[2][0] - c[2][1] - c[2][2]
             )):
                result = 'Yes'
                break
print(result)

Fixed submission:
n = int(input())
a = int(input())

rest = n % 500
if rest <= a :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = [int(c) for c in input().split{' '}]
print((a+b-1)/2)

Fixed submission:
a,b = [int(c) for c in input().split(' ')]
carry = (a+b)%2
print(int((a+b)/2) + carry)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print((a+b-1)/2)

Fixed submission:
a,b = [int(c) for c in input().split(' ')]
carry = (a+b)%2
print(int((a+b)/2) + carry)
Buggy python submission (verdict: Runtime Error):
a,b.c = [int(c) for c in input()]
i = c * 100 + b * 10 + a
if i % 4 == 0:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c = [int(c) for c in input().split(' ')]
i = a * 100 + b * 10 + c
if i % 4 == 0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(c) for c in input().split(' ')]
prev = None
c = 1
inc = None

for i in range(l):
    current = a[i]
    if i == 0 :
        continue
    if inc == None:
        if a[i] > a[i-1] :
            inc = True
        elif             a[i] < a[i - 1]:
            inc = False
        else:
            continue 
    elif inc == True:
        if a[i-1] < a[i]:
            pass
        elif a[i -1] > a[i]:
            c += 1
            inc = None
    elif inc == False:
        if a[i-1] > a[i]:
            pass
        elif a[i - 1] < a[i]:
            c += 1
            inc = None
print(c)


Fixed submission:
n = int(input())
a = [int(c) for c in input().split(' ')]
#a = [1 ,2 ,1 ,2 ,1 ,2 ,1 ,2 ,1]
l = len(a)
prev = None
c = 1
inc = None

for i in range(l):
    current = a[i]
    if i == 0 :
        continue
    if inc == None:
        if a[i] > a[i-1] :
            inc = True
        elif             a[i] < a[i - 1]:
            inc = False
        else:
            continue 
    elif inc == True:
        if a[i-1] < a[i]:
            pass
        elif a[i -1] > a[i]:
            c += 1
            inc = None
    elif inc == False:
        if a[i-1] > a[i]:
            pass
        elif a[i - 1] < a[i]:
            c += 1
            inc = None
print(c)
Buggy python submission (verdict: Runtime Error):
S = list(map(int, input().split()))
T = list(map(int, input().split()))

i = 0
reslt = 0
for item in S:
    if S[i] == T[i]:
        reslt += 1
    i += 1

print(result)


Fixed submission:
S = input()
T = input()

i = 0
result = 0
for item in [0,0,0]:
    if S[i] == T[i]:
        result += 1
    i += 1

print(result)