Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
num_ints = int(input())
sum_ints = sum([int(i) for i in input().split()])

if sum % 2 == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
num_ints = int(input())
sum_ints = sum([int(i) for i in input().split()])

if sum_ints % 2 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
seq_a = []
seq_b = []
seq_n = int(input())
for i in range(seq_n):
    num_a,num_b=map(int,input().split())
    seq_a.append(num_a)
    seq_b.append(num_b)
x = 0
for i in range(seq_n - 1, -1 ,-1):
    seq_n , elem_b = seq_a[i],seq_b[i]
    y = (seq_n + x)% elem_b
    if y != 0: x += (m-y)
print(x)

Fixed submission:
a=[]
b=[]
n=int(input())
for i in range(n):
    j,k=map(int,input().split())
    a.append(j)
    b.append(k)
x=0
for i in range(n-1,-1,-1):
    n,m=a[i],b[i]
    y=(n+x)%m
    if y!=0:x+=m-y
print(x)

Buggy python submission (verdict: Runtime Error):
seq_a = []
seq_b = []
seq_n = int(input())
for i in range(seq_n):
    num_a,num_b=map(int,input().split())
    seq_a.append(num_a)
    seq_b.append(num_b)
x = 0
for i in range(seq_n - 1, -1 ,-1):
    elem_a , elem_b = seq_a[i],seq_b[i]
    y = (elem_a + x)% elem_b
    if y != 0: x += (m-y)
print(x)

Fixed submission:
a=[]
b=[]
n=int(input())
for i in range(n):
    j,k=map(int,input().split())
    a.append(j)
    b.append(k)
x=0
for i in range(n-1,-1,-1):
    n,m=a[i],b[i]
    y=(n+x)%m
    if y!=0:x+=m-y
print(x)

Buggy python submission (verdict: Runtime Error):
seq_a = []
seq_b = []
seq_n = int(input())
for i in range(seq_n):
    num_a,num_b=map(int,input().split())
    a.append(num_a)
    b.append(num_b)
x = 0
for i in range(seq_n - 1, -1 ,-1):
    elem_a , elem_b = seq_a[i],seq_b[i]
    y = (elem_a + x)% elem_b
    if y != 0: x += (m-y)
print(x)

Fixed submission:
a=[]
b=[]
n=int(input())
for i in range(n):
    j,k=map(int,input().split())
    a.append(j)
    b.append(k)
x=0
for i in range(n-1,-1,-1):
    n,m=a[i],b[i]
    y=(n+x)%m
    if y!=0:x+=m-y
print(x)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = []
for i in range(N):
  S, P = input().split()
  a.append((S, 100-P, i+1))
a.sort()
for i in a:
  print(i[2])

  

Fixed submission:
import numpy as np
N = int(input())
a = []
for i in range(N):
  S, P = input().split()
  a.append((S, 100-int(P), i+1))
a.sort()
for i in a:
  print(i[2])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower+s[k:])

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])
Buggy python submission (verdict: Time Limit Exceeded):
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0 and (n - b*y - c*z) >= 0:
            count += 1
print(count)

Fixed submission:
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range(n//c+1):
        if (n - b*y - c*z) % a == 0 and (n - b*y - c*z) >= 0:
            count += 1
print(count)

Fixed submission:
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range(n//c+1):
        x = (n - b*y - c*z) / a
        if int(x) == x and x >= 0:
            count += 1
print(count)

Fixed submission:
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, n = map(int, input().split())
count = 0
for y in range(n//b+1):
    for z in range(n//c+1):
        x = (n - b*y - c*z) / a
        if int(x) == x and x >= 0:
            count += 1
print(count)

Fixed submission:
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0:
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, n = map(int, input().split())
count = 0
for y in range(n+1):
    for z in range(n+1):
        x = (n - b*y - c*z) / a
        if int(x) == x and x >= 0:
            count += 1
print(count)

Fixed submission:
*j, n = map(int, input().split())
j.sort()
a, b, c = j
count = 0
for y in range(n//b+1):
    for z in range((n-y*b)//c+1):
        if (n - b*y - c*z) % a == 0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ss = [input() for _ in range(n)]
ans = 0
count_ab = 0 # if ab exists
count_a = 0 # if end in a
count_b = 0 # if start in b
count_ba = 0 # if start in b and end in a
for s in ss:
  slen = len(s)
  if s[0] == 'B' and  s[-1] == 'A':
    count_ba +=1
  else:
      if s[0] == 'B':
        count_b +=1
      if s[-1] == 'A':
        count_a +=1
  count_ab += s.count("AB")

if count_ba == 0:
    print(count_ab + min(count_a, count_b))
elif count_a == 0 and count_b == 0:
    print(count_ab + count+ba -1)
elif count_a > 0 and count_b > 0:
    print(count_ab +  min(count_a, count_b) + count_ba)
else:
    print(count_ab + count_ba)

Fixed submission:
n = int(input())
ss = [input() for _ in range(n)]
ans = 0
count_ab = 0 # if ab exists
count_a = 0 # if end in a
count_b = 0 # if start in b
count_ba = 0 # if start in b and end in a
for s in ss:
  slen = len(s)
  if s[0] == 'B' and  s[-1] == 'A':
    count_ba +=1
  else:
      if s[0] == 'B':
        count_b +=1
      if s[-1] == 'A':
        count_a +=1
  count_ab += s.count("AB")
 
if count_ba == 0:
    print(count_ab + min(count_a, count_b))
elif count_a == 0 and count_b == 0:
    print(count_ab + count_ba - 1)
elif count_a > 0 and count_b > 0:
    print(count_ab +  min(count_a, count_b) + count_ba)
else:
    print(count_ab + count_ba)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import copy

h, w = map(int, input().split())
map = [input() for _ in range(h)]
mapB = np.zeros((h, w))
for i, ii in enumerate(map):
  for j, jj in enumerate(ii):
    if jj == '#':
      mapB[i, j] = 1
map = copy.deepcopy(mapB)
      
count = 0
done = False

while not done:
  count +=1
  for i in range(w):
    for j in range(h):
      if map[i, j] >= 1:
          mapB[max(0, i-1), j] = 1 
          mapB[i, max(0, j-1)] = 1 
          mapB[min(h-1, i+1), j] = 1 
          mapB[i, min(w-1, j+1)] = 1 

  if mapB.all():
    done = True
    break
  
  map = map + mapB
  
print(count)

Fixed submission:
import numpy as np
from scipy import ndimage

h, w = map(int, input().split())
map = [input() for _ in range(h)]
mapB = np.zeros((h, w))
for i, ii in enumerate(map):
  for j, jj in enumerate(ii):
    if jj == '.':
      mapB[i, j] = 1
dist = ndimage.distance_transform_cdt(mapB, metric="taxicab")
print(dist.max())
Buggy python submission (verdict: Runtime Error):
X = int(input())
if X == 3 or X == 5 or X == 7:
 	print("Yes")
else
 	print("No")

Fixed submission:
#-*- coding : utf-8 -*-
X = int(input())
if X == 3 or X == 5 or X == 7:
 	print("YES")
else:
 	print("NO")

Buggy python submission (verdict: Runtime Error):
X = int(input())
if X == 3 or X == 5 or X == 7:
  print("Yes")
else
  print("No")

Fixed submission:
#-*- coding : utf-8 -*-
X = int(input())
if X == 3 or X == 5 or X == 7:
 	print("YES")
else:
 	print("NO")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())

if (A > 8) or (B > 8):
    print (":(")
else:
     print ("Yay!")

Fixed submission:
# -*- coding: utf-8 -*-
A, B = map(int, input().split())

if (A > 8) or (B > 8):
    print (":(")
else:
    print ("Yay!")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 09:36:44 2017

@author: kotania
"""

N = int(input())
lrList = [""]*N
for n in range(0,N):
    lrList[n] = input()

sum = 0
for lr in lrList:
    sum += (int(lr.split()[1]) - int(lr.split()[0]) + 1)
    
print(sum)


Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 09:31:04 2017

@author: kotania
"""

N = input()

if int(N) > 89 :
    print("Yes")
elif N[1] == "9":
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
import itertools

def is_lit(i, bit):
    l = [bit[j-1] for j in sockets[i]]
    return p[i] == l.count(True) % 2

count = 0
N, M = map(int, input().split())
bit_list = list(itertools.product([True, False], repeat = N))

sockets = []
for i in range(M):
    args = input().split(' ')
    k = int(args[0])
    sockets.append([int(args[i+1]) for i in range(k)])

p = [int(x) for x in input().split(' ')]

for bit in bit_list:
    o = [is_lit(i, bit) for i in range(M)]
    if o.count(True) == len(o):
        count += 1

print(count)


Fixed submission:
A ,P = map(int,input().split())
print(int((3*A + P) /2))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = input().split(" ")
if M == 1:
    a, b = input().split(" ")
    print(int(b)-int(a)+1)
else:    
    a, b = input().split(" ")
    sets = set([i for i in range(int(a),int(b)+1)])
    for m in range(int(M)-1):
        a, b = input().split(" ")
        sets = sets & set([i for i in range(int(a),int(b)+1)])
    print(len(sets))

Fixed submission:
N, M = input().split(" ")
#S = []
if M == 1:
    a, b = input().split(" ")
    print(int(b)-int(a)+1)
else:    
    a, b = input().split(" ")
    aM, bm = int(a),int(b)
    #sets = set([i for i in range(int(a),int(b)+1)])
    for m in range(int(M)-1):
        a, b = input().split(" ")
        aM = max(aM,int(a))
        bm = min(bm,int(b))
        #sets = sets & set([i for i in range(int(a),int(b)+1)])
    if(bm<aM):
        print(0)
    else:
        print(int(bm)-int(aM)+1)

Buggy python submission (verdict: Time Limit Exceeded):
S = []
N, M = input().split(" ")
for m in range(int(M)):
  a, b = input().split(" ")
  S.append(set([i for i in range(int(a),int(b)+1)]))
if M == 1:
  print(len(S[0]))
else:
  sets = S[0]
  for i in range(1,int(M)):
    sets = sets & S[i]
  print(len(sets))

Fixed submission:
N, M = input().split(" ")
#S = []
if M == 1:
    a, b = input().split(" ")
    print(int(b)-int(a)+1)
else:    
    a, b = input().split(" ")
    aM, bm = int(a),int(b)
    #sets = set([i for i in range(int(a),int(b)+1)])
    for m in range(int(M)-1):
        a, b = input().split(" ")
        aM = max(aM,int(a))
        bm = min(bm,int(b))
        #sets = sets & set([i for i in range(int(a),int(b)+1)])
    if(bm<aM):
        print(0)
    else:
        print(int(bm)-int(aM)+1)

Buggy python submission (verdict: Runtime Error):
S = []
N, M = input().split(" ")
for m in range(len(int(M))):
  S.append(set([i for i in range(int(a),int(b)+1)]))
if M == 1:
  print(len(S[0]))
else:
  sets = S[0]
  for i in range(1,M):
    sets = sets & S[i]
  print(len(sets))

Fixed submission:
N, M = input().split(" ")
#S = []
if M == 1:
    a, b = input().split(" ")
    print(int(b)-int(a)+1)
else:    
    a, b = input().split(" ")
    aM, bm = int(a),int(b)
    #sets = set([i for i in range(int(a),int(b)+1)])
    for m in range(int(M)-1):
        a, b = input().split(" ")
        aM = max(aM,int(a))
        bm = min(bm,int(b))
        #sets = sets & set([i for i in range(int(a),int(b)+1)])
    if(bm<aM):
        print(0)
    else:
        print(int(bm)-int(aM)+1)
Buggy python submission (verdict: Runtime Error):
import math
N, K = input().split(" ")
N, K = int(N), int(K)
P = 0
if (N < K):
  for n in N:
    P += 1/(N*math.ceil(math.log2(K)-math.log2(n)))
else:
  for n in K:
    P += 1/(N*math.ceil(math.log2(K)-math.log2(n)))
  P += (K-N)/N
print(P)

Fixed submission:
import math
N, K = input().split(" ")
N, K = int(N), int(K)
P = 0
if (N < K):
  for n in range(1,N+1):
    P += 1/(N*pow(2,math.ceil(math.log2(K)-math.log2(n))))
else:
  for n in range(1, K+1):
    P += 1/(N*pow(2,math.ceil(math.log2(K)-math.log2(n))))
  P += (N-K)/N
print(P)

Buggy python submission (verdict: Runtime Error):
import math
N, K = input().split(" ")
N, K = int(N), int(K)
P = 0
if (N < K):
  for n in N:
    P += 1/(N*math.ceil(math.log2(K)-math.log2(n)))
else:
  for n in K:
    P += 1/(N*math.ceil(math.log2(K)-math.log2(n)))
  P += (K-N)/N
print(K)


Fixed submission:
import math
N, K = input().split(" ")
N, K = int(N), int(K)
P = 0
if (N < K):
  for n in range(1,N+1):
    P += 1/(N*pow(2,math.ceil(math.log2(K)-math.log2(n))))
else:
  for n in range(1, K+1):
    P += 1/(N*pow(2,math.ceil(math.log2(K)-math.log2(n))))
  P += (N-K)/N
print(P)
Buggy python submission (verdict: Runtime Error):
N = int(input())
i = int(input())
print(int(N+1-i))


Fixed submission:
n,i = map(int,input().split(" "))
print(n+1-i)

Buggy python submission (verdict: Runtime Error):
N = int(input())
i = int(input())
print(N+1-i)

Fixed submission:
n,i = map(int,input().split(" "))
print(n+1-i)
Buggy python submission (verdict: Time Limit Exceeded):
#D
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
num=[[] for i in range(m)]
for i in range(m):
    x,y=map(int,input().split())
    num[i]=[y,x]
num.sort(reverse=True)
for i in range(m):
    for j in range(num[i][1]):
        if a[j]<num[i][0]:
            a[j]=num[i][0]
        else:
            break
    a.sort()

print(sum(a))

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[[a[i],1] for i in range(n)]
for i in range(m):
    x,y=map(int,input().split())
    b.append([y,x])
b.sort(reverse=True)
ans=0
cnt=n
for i in range(len(b)):
    use=min(b[i][1],cnt)
    ans+=use*b[i][0]
    cnt-=use
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
for i in range(m):
    b,c=map(int,input().split())
    for j in range(b):
        if a[j]<c:
            a[j]=c
        else:
            break
    a.sort()
print(sum(a))

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[[a[i],1] for i in range(n)]
for i in range(m):
    x,y=map(int,input().split())
    b.append([y,x])
b.sort(reverse=True)
ans=0
cnt=n
for i in range(len(b)):
    use=min(b[i][1],cnt)
    ans+=use*b[i][0]
    cnt-=use
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
ans=0
m=[]
N=int(input())
rN=math.floor(math.sqrt(N))
for i in range(1,rN+1):
    if N%i==0:
        m.append(i)
        m.append(int(N/i))
    else:
        pass
m.sort()
m2=list(map(lambda x: x-1,m))
m2.pop(0)
for i in m2:
    a,b=divmod(N,i)
    if a==b:
        ans+=i
    else:
        pass
print(ans)

Fixed submission:
import math
ans=0
m=[]
N=int(input())
rN=math.floor(math.sqrt(N))
for i in range(1,rN+1):
    if N%i==0:
        m.append(i)
        m.append(int(N/i))
    else:
        pass
m.sort()
m2=list(map(lambda x: x-1,m))
for i in m2:
    if i==0:
        pass
    else:
        a,b=divmod(N,i)
        if a==b:
            ans+=i
        else:
            pass
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
num=[]
for i in range(1,N):
    a=N%i
    b=N//i
    if a==b:
        num.append(i)
    else:
        pass
print(sum(num))

Fixed submission:
import math
ans=0
m=[]
N=int(input())
rN=math.floor(math.sqrt(N))
for i in range(1,rN+1):
    if N%i==0:
        m.append(i)
        m.append(int(N/i))
    else:
        pass
m.sort()
m2=list(map(lambda x: x-1,m))
for i in m2:
    if i==0:
        pass
    else:
        a,b=divmod(N,i)
        if a==b:
            ans+=i
        else:
            pass
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
if N%500<=A：
    print("Yes")
else:
    print("No")

Fixed submission:
N=int(input())
A=int(input())
if N%500<=A:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans=0
a=math.floor(X/500)
for i in range(min(A,a)+1):
    X2=X-500*i
    b=math.floor(X2/100)
    for j in range(min(B,b)+1):
        X3=X2-100*j
        if X3%50==0:
            c=X3/50
            if c<=C:
                ans+=1
            else:
                continue
        else:
            continue
print(ans)

Fixed submission:
import math
X=int(input())
A=int(input())
B=int(input())
num=math.floor((X-A)/B)
print(X-A-B*num)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=0
for i,j in enumerate(A):
    if j%2!=0:
        print(ans)
        exit()
    else:
        A[i]=j/2
    count+=1

Fixed submission:
sss=list(input())
print(sss.count('1'))

Buggy python submission (verdict: Runtime Error):
N=int(input)
A=list(int(input().split()))
ans=0
flag=True
if flag==True:
    for i in range(N)
        if A[i]%2==0:
            A[i]=A[i]/2
        else:
            flag=False
            break
    ans+=1
else:
    break
        
print(ans)

Fixed submission:
sss=list(input())
print(sss.count('1'))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=0
for i,j in enumerate(A):
    if j%2!=0:
        print(ans)
        exit()
    else:
        A[i]=j/2
    count+=1

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
flag=False
ans=0
while True:
    for i,j in enumerate(A):
        if j%2!=0:
            print(ans)
            flag=True
            break
        else:
            A[i]=j/2
    ans+=1 
    if flag:
        break
Buggy python submission (verdict: Runtime Error):
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() #setを使うと重複がなくなる
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E<s:
            pass
        elif s+w>F or s+w==0:
            pass
        else
            den=s/(s+w)
            if den>density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                pass
print(Ans1,Ans2)

Fixed submission:
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() 
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E>=s and s+w<=F and s+w!=0:
            den=s/(s+w)
            if den>=density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                break
print(Ans1,Ans2)

Buggy python submission (verdict: Runtime Error):
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() #setを使うと重複がなくなる
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E<s:
            pass
        elif s+w>F or s+w=0:
            pass
        else
            den=s/(s+w)
            if den>density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                pass
print(Ans1,Ans2)

Fixed submission:
#C
A,B,C,D,E,F=map(int,input().split())
density=0
Ans1=0
Ans2=0
water=set() 
sugar=set()

bm=F//(100*B)
for i in range(bm+1):
    rw=F-100*i*B
    am=rw//(100*A)
    for j in range(am+1):
        water.add(100*i*B+100*j*A)

dm=F//D
for i in range(dm+1):
    rs=F-i*D
    cm=rs//C
    for j in range(cm+1):
        sugar.add(i*D+j*C)
sugar=sorted(sugar)
water=sorted(water)
for s in sugar:
    for w in water:
        if w/100*E>=s and s+w<=F and s+w!=0:
            den=s/(s+w)
            if den>=density:
                density=den
                Ans1=s+w
                Ans2=s
            else:
                break
print(Ans1,Ans2)
Buggy python submission (verdict: Time Limit Exceeded):
A=list(map(int,input().split()))
K=A[0]
S=A[1]
count=0
for a in range(K+1):
    for b in range(K+1):
        for c in range(K+1):
            if a+b+c==S:
                count+=1
            else:
                continue
print(count)

Fixed submission:
A=list(map(int,input().split()))
K=A[0]
S=A[1]
count=0
for a in range(K+1):
    for b in range(K+1):
        c=S-a-b
        if 0<=c<=K:
            count+=1
        else:
            continue
print(count)
Buggy python submission (verdict: Runtime Error):
W,H,N=map(int,input().split())
xM=W
xm=0
yM=H
ym=0
for i in range(N):
    a=list(map(int,input().split()))
    if a[2]==1:
        if a[0]>xm:
            xm=a[0]
        else:
            break
    elif a[2]==2:
        if a[0]<xM:
            xM=a[0]
        else:
            break
    elif a[2]==3:
        if a[1]>ym:
            ym=a[1]
        else:
            break
    else:
        if a[1]<yM:
            yM=a[1]
        else: 
            break
xl=xM-xm
yl=yM-ym
print(xl*yl)

Fixed submission:
A=sorted(list(map(int,input().split())),reverse=True)
if A[0]==A[1]+A[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,K=input().split()
D=list(map(int,input().split()))
for i in N:
    if int(i) in D:
        N[i]+=1
    else:
        pass
print(''.join(N))

Fixed submission:
N,K=map(int,input().split())
D=list(map(int,input().split()))
for i in range(N,10*N+1):
    I=list(map(int,str(i)))
    match=list(set(I)&set(D))
    if len(match)==0:
        print(i)
        break
    else:
        pass

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
D=list(map(int,input().split()))
NL=len(str(N))
ans=[]
allnum=list(range(10))
use=list(set(allnum)^set(D))
for i in range(NL):
    a=int(str(N)[i])
    for j in use:
        if a<=j:
            ans.append(j)
            break
        else:
            continue
if ans[0]==0:
    ans[0]=use[1]
else:
    pass
print(int(''.join(map(str,ans))))

Fixed submission:
N,K=map(int,input().split())
D=list(map(int,input().split()))
for i in range(N,10*N+1):
    I=list(map(int,str(i)))
    match=list(set(I)&set(D))
    if len(match)==0:
        print(i)
        break
    else:
        pass
Buggy python submission (verdict: Runtime Error):
N, Q = [int(i) for i in input().split()]
S = input()
tdList = reversed([input().split() for _ in range(Q)])

l, r = 0, N - 1
for td in tdList:
    print("td:",td)
    print("S:",S)
    if td[0] == S[l] and td[1] == "L":
        print("pa1")
        l += 1
        print(l,r)
    elif td[0] == S[r] and td[1] == "R":
        print("pa2")
        r -= 1
        print(l,r)
    if l != 0 and S[l - 1] == td[0] and td[1] == "R":
        print("pa3")
        l -= 1
        print(l,r)
    if r != N - 1 and S[r + 1] == td[0] and td[1] == "L":
        print("pa4")
        r += 1
        print(l,r)
    if l > N - 1 or r < 0:
        print(l,r)
        print("break")
        break

ans = 0
if r >= l:
    ans = r - l + 1

print(ans)

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