Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, k=map(int, input().split())

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


def blue_pattern(ball, pat):
    if pat == 1:
        return 1
    return pat

def out(num):
    print(num%1000000007)

for i in range(1, k+1):
    out(cmb(n-k+1,i)*cmb(k-1, i-1))



Fixed submission:
n, k=map(int, input().split())

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


def out(num):
    print(num%1000000007)

for i in range(1, k+1):
    if n-k+1 < i:
        print("0")
    else:
        out(cmb(n-k+1,i)*cmb(k-1, i-1))
Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b,c,d=map(int, input().split())
re=[]
cd=lcm(c, d)

cc=int(b/c - a/c)
dc=int(b/d - a/d)
cdc=int(b/cd - a/cd)

print(b-a-cc-dc+cdc)

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b,c,d=map(int, input().split())
cd=lcm(c, d)

cc=b//c - (a-1)//c
dc=b//d - (a-1)//d
cdc=b//cd - (a-1)//cd

print(b-(a-1)-cc-dc+cdc)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a=[]
for i in range(m):
    a.append(int(input()))

r=[0]*(n+1)
r[0]=1

for i in range(1,n+1):
    if i in a:
        continue
    r[i]=(r[i-1]+r[i-2])%1000000007

print(r[n])

Fixed submission:
n, m = map(int, input().split())

a=[True]*(n+1)
for i in range(m):
    a[int(input())]=False

r=[0]*(n+1)
r[0]=1

for i in range(1,n+1):
    if not a[i]:
        continue
    r[i]=(r[i-1]+r[i-2])%1000000007

print(r[n])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a=[]
for i in range(m):
    a.append(int(input()))

r=[0]*(n+1)
r[0]=1

for i in range(1,n+1):
    if i in a:
        continue
    r[i]=r[i-1]+r[i-2]

print(r[n]%1000000007)


Fixed submission:
n, m = map(int, input().split())

a=[True]*(n+1)
for i in range(m):
    a[int(input())]=False

r=[0]*(n+1)
r[0]=1

for i in range(1,n+1):
    if not a[i]:
        continue
    r[i]=(r[i-1]+r[i-2])%1000000007

print(r[n])
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n, m = map(int, input().split())

ans=[]
def targetAdd(a):
    bisect.insort_left(ans, a)

for i in range(n):
    a, b = map(int, input().split())
    for j in range(b):
        targetAdd(a)

print(sum(ans[:m]))


Fixed submission:
import bisect

n, m = map(int, input().split())

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

ab = sorted(ab, key=lambda x: x[0])

def func():
    c=0
    ans=0

    for target in ab:
        for i in range(target[1]):
            ans+=target[0]
            c+=1

            if c == m:
                return ans
            

print(func())

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ab=[]
for i in range(n):
    a, b = map(int, input().split())
    for j in range(b):
        ab.append(a)

ab.sort()
print(sum(ab[:m]))


Fixed submission:
import bisect

n, m = map(int, input().split())

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

ab = sorted(ab, key=lambda x: x[0])

def func():
    c=0
    ans=0

    for target in ab:
        for i in range(target[1]):
            ans+=target[0]
            c+=1

            if c == m:
                return ans
            

print(func())
Buggy python submission (verdict: Runtime Error):
data = input().split()
n = int(data[0])
m = int(data[1])
edge=[]
for i in range(m):
    tmp = []
    data = input().split()
    tmp.append(int(data[0])-1)
    tmp.append(int(data[1])-1)
    edge.append(tmp)

grp=list(range(0, n))
def group(num):
    if grp[num] == num:
        return num
    return group(grp[num])

def merge(num1, num2):
    grp[num2]=grp[num1]

res=[]
ans = [1]*n
ben = int(n*(n-1)/2)
edge.reverse()
for e in edge:
    #print(e, ans, ben, grp)
    res.append(ben)
    g0 = group(e[0])
    g1 = group(e[1])
    if g0 != g1:
        ben -= ans[g0]*ans[g1]
        sum = ans[g0]+ans[g1]
        merge(g0, g1)
        ans[g0]=sum
        ans[g1]=sum

res.reverse()
for r in res:
    print(r)

#print(int(n*(n-1)/2))

Fixed submission:
data = input().split()
a = int(data[0])
b = int(data[1])
c = int(data[2])

if b >= (a*c):
    print(c)
else:
    print(int(b/a))
Buggy python submission (verdict: Runtime Error):
data = input().split()
a = int(data[0])
b = int(data[1])
k = int(data[2])

ans = []
for i in range(1, a if a < b else b):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[k-1])


Fixed submission:
data = input().split()
a = int(data[0])
b = int(data[1])
k = int(data[2])
 
ans = []
for i in range(1, a+1 if a < b else b+1):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[len(ans)-k])
Buggy python submission (verdict: Runtime Error):
import copy as copy
s = input()
dic={}

def pre():
    global s
    n = 0
    while '1100' in s:
        s=s.replace('1100', '10', 1)
        n+=2

    while '0011' in s:
        s=s.replace('0011', '01', 1)
        n+=2
    
    while '10101' in s:
        s=s.replace('10101', '101', 1)
        n+=2
    
    while '01010' in s:
        s=s.replace('01010', '010', 1)
        n+=2

    return n

def func(val, n):
    if val in dic:
        return dic[val]

    if not ('1' in val):
        return n
    elif not ('0' in val):
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(val.replace('01', '', 1), n+2)
    if '10' in val:
        b = func(val.replace('10', '', 1), n+2)
    
    ans=max(a, b, n)
    dic[val]=ans

    return ans

ans=pre()
print(func(s, ans))


Fixed submission:
s = input()

print(min(s.count('0'), s.count('1'))*2)

Buggy python submission (verdict: Runtime Error):
import copy as copy
s = input()
dic={}

def func(val, n):
    if val in dic:
        return dic[val]

    if not ('1' in val):
        return n
    elif not ('0' in val):
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(val.replace('01', '', 1), n+2)
    if '10' in val:
        b = func(val.replace('10', '', 1), n+2)
    
    ans=max(a, b, n)
    dic[val]=ans

    return ans

print(func(s, 0))


Fixed submission:
s = input()

print(min(s.count('0'), s.count('1'))*2)

Buggy python submission (verdict: Runtime Error):
import copy as copy
s = input()
dic={}

def func(val, n):
    if val in dic:
        return dic[val]

    if not ('1' in val):
        return n
    elif not ('0' in val):
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(val.replace('01', '', 1), n+2)
    if '10' in val:
        b = func(val.replace('10', '', 1), n+2)
    
    ans=max(a, b, n)

    dic[val]=ans

    return ans

print(func(s, 0))


Fixed submission:
s = input()

print(min(s.count('0'), s.count('1'))*2)

Buggy python submission (verdict: Runtime Error):
import copy as copy
s = input()

def func(val, n):
    if len(val) < 2:
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(copy.copy(val.replace('01', '', 1)), n+2)
    if '10' in val:
        b = func(copy.copy(val.replace('10', '', 1)), n+2)
    
    return max(a, b, n)

print(func(s, 0))


Fixed submission:
s = input()

print(min(s.count('0'), s.count('1'))*2)

Buggy python submission (verdict: Runtime Error):
s = input()

def func(val, n):
    if len(val) < 2:
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(val.replace('01', '', 1), n+2)
    if '10' in val:
        b = func(val.replace('10', '', 1), n+2)
    
    return max(a, b, n)

print(func(s, 0))


Fixed submission:
s = input()

print(min(s.count('0'), s.count('1'))*2)
Buggy python submission (verdict: Runtime Error):
data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i
y.pop(0)

y.sort()
y.reverse()

res=x[-1]-x[0]

if(len(y)+1 < n):
    n = len(y)+1

for i in range(n-1):
    res-=y[i]

print(res)

Fixed submission:
data = input().split()
  
t = int(data[0])
x = int(data[1])


print(t/x)

Buggy python submission (verdict: Runtime Error):
data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i
y.pop(0)

y.sort()
y.reverse()

res=x[-1]-x[0]

print(x)
print(y)

if(len(y)+1 < n):
    n = len(y)+1

for i in range(n-1):
    res-=y[i]

print(res)

Fixed submission:
data = input().split()
  
t = int(data[0])
x = int(data[1])


print(t/x)
Buggy python submission (verdict: Runtime Error):
data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i

y.sort()
y.reverse()


res=x[-1]-x[0]


for i in range(n-1):
    res-=y[i]


print(res)

Fixed submission:
data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i
y.pop(0)

y.sort()
y.reverse()

res=x[-1]-x[0]

if(len(y)+1 < n):
    n = len(y)+1

for i in range(n-1):
    res-=y[i]

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
data = input().split()

n = int(data[0])
a=[]
valueList=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    a.append(tmp)
    valueList.append(int(line[1]) + int(line[0]))

res=0

for i in range(n):
    ind = valueList.index(max(valueList))
    if(i%2 == 0):
        res += a[ind][0]
    else:
        res -= a[ind][1]
    a.pop(ind)
    valueList.pop(ind)

print(res)


Fixed submission:
data = input().split()

n = int(data[0])
a=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[1]) + int(line[0]))
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    a.append(tmp)

res=0
a.sort(key=lambda x: x[0])
a.reverse()

flg=True

for e in a:
    if(flg):
        res +=e[1]
    else:
        res -=e[2]
    flg=not(flg)
    

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split()

n = int(data[0])
a=[]
valueList=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    a.append(tmp)
    valueList.append(int(line[1]) + int(line[0]))


taka=0
ao=0

for i in range(n):
    ind = valueList.index(max(valueList))
    if(i%2 == 0):
        taka += a[ind][0]
    else:
        ao += a[ind][1]
    a.pop(ind)
    valueList.pop(ind)

print(taka-ao)


Fixed submission:
data = input().split()

n = int(data[0])
a=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[1]) + int(line[0]))
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    a.append(tmp)

res=0
a.sort(key=lambda x: x[0])
a.reverse()

flg=True

for e in a:
    if(flg):
        res +=e[1]
    else:
        res -=e[2]
    flg=not(flg)
    

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split()

n = int(data[0])
a=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    tmp.append(int(line[1]) - int(line[0]))
    tmp.append(int(line[0]) - int(line[1]))
    a.append(tmp)

taka=0
ao=0

for i in range(n):
    value=0
    diff=-10000000000
    ind=0
    for j in range(len(a)):
        if(i%2==0 and diff+value <= a[j][2]+a[j][0] and value <= a[j][0]):
            value=a[j][0]
            diff=a[j][2]
            ind=j
        elif(i%2!=0 and diff+value <= a[j][3]+a[j][1] and value <= a[j][1]):
            value=a[j][1]
            diff=a[j][3]
            ind=j
    if(i%2 == 0):
        taka += value
    else:
        ao += value
    a.pop(ind)

print(taka-ao)


Fixed submission:
data = input().split()

n = int(data[0])
a=[]
for i in range(n):
    line = input().split()
    tmp=[]
    tmp.append(int(line[1]) + int(line[0]))
    tmp.append(int(line[0]))
    tmp.append(int(line[1]))
    a.append(tmp)

res=0
a.sort(key=lambda x: x[0])
a.reverse()

flg=True

for e in a:
    if(flg):
        res +=e[1]
    else:
        res -=e[2]
    flg=not(flg)
    

print(res)
Buggy python submission (verdict: Runtime Error):
inputs = list(map(int, input().split()))
print(min(inputs[:2]) + min(inputs[2:]))

Fixed submission:
inputs = [int(input()) for _ in range(4)]
print(min(inputs[:2]) + min(inputs[2:]))

Buggy python submission (verdict: Runtime Error):
inputs = map(int, input().split())
print(min(inputs[:2]) + min(inputs[2:]))

Fixed submission:
inputs = [int(input()) for _ in range(4)]
print(min(inputs[:2]) + min(inputs[2:]))
Buggy python submission (verdict: Runtime Error):

r, g, b = list(map(int, input()))
a = r*100+g*10+b

if a % 4 == 0:
    print('Yes')
else:
    print('No')


Fixed submission:

r, g, b = list(map(int, input().split()))
a = r*100+g*10+b

if a % 4 == 0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
p = 1

for i in range(1, N+1):
    p *= i

print(p % 1000000007)


Fixed submission:

N = int(input())
p = 1

for i in range(1, N+1):
    p *= i
    p = p % (10**9+7)

print(p)

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
p = 1

for i in range(1, N+1):
    p *= i

print(p % 1000000007)


Fixed submission:

N = int(input())
p = 1

for i in range(1, N+1):
    p *= i
    p = p % (10**9+7)

print(p)
Buggy python submission (verdict: Runtime Error):

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

A_ = sorted(A)

if len(A_) == 1:
    if A_[0] == 0:
        print(1)
    else:
        print(0)

else:

    if len(A_) % 2 == 0:
        if A_[0] != 0 or A_[1] != 0:
            print(0)
            exit()

    else:
        if A_[0] != 0 or A_[1] == 0:
            print(0)
            exit()





    for i in range(len(A_) // 2):
        if A_[2*i] != A_[2*i+1]:
            print(0)
            exit()


    ans_ = 2 ** (N // 2)
    ans = ans_ % (10**9 + 7)
    print(ans)


Fixed submission:


a, o, b = input().split()
a = int(a)
b = int(b)

if o == '+':
    print(a+b)
elif o == '-':
    print(a-b)
Buggy python submission (verdict: Runtime Error):

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

def need_to_eat(a, i):
    return a[i] + a[i+1] > x


for i in range(N-1):
    while need_to_eat(a, i):
        a[i] -= 1
        ans += 1

print(ans)


Fixed submission:

s = input().split()
output = ''

for s_i in s:
    output += s_i[0]

print(output)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = int

d = a
a = b
b = d 
d = c 
c = a
a = d
print(a,b,c)


Fixed submission:
a,b,c = input().split()

d = int

d = a
a = b
b = d 
d = c 
c = a
a = d
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
X = int(input())

print( (X//500)*1000 + ((X%500)//5)*5 

Fixed submission:
X = int(input())

print( (X//500)*1000 + ((X%500)//5)*5 )
Buggy python submission (verdict: Runtime Error):

S = input()
N = len(S)

S1 = S[:(N-1)/2]
S2 = S[(N+3)/2:]

print("Yes" if S1 == sorted(S1)[::-1] and S2== sorted(S2)[::-1] else "No")


Fixed submission:

S = input()
N = len(S)

S1 = S[:(N-1)//2]
S2 = S[(N+3)//2 - 1:]

print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2== S2[::-1] else "No")

Buggy python submission (verdict: Runtime Error):

S = input()
N = len(S)

print("Yes" if S[:(N-1)/2]== sorted(S)[:(N-1)/2:-1] and S[(N+3)/2:]== sorted(S)[(N+3)/2::-1] else "No")


Fixed submission:

S = input()
N = len(S)

S1 = S[:(N-1)//2]
S2 = S[(N+3)//2 - 1:]

print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2== S2[::-1] else "No")

Buggy python submission (verdict: Runtime Error):

S = input()
N = len(S)

print("Yes" if len(set(S[:(N-1)//2])) == 2 and len(set(S[(N+3)//2:])==2 else "No")


Fixed submission:

S = input()
N = len(S)

S1 = S[:(N-1)//2]
S2 = S[(N+3)//2 - 1:]

print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2== S2[::-1] else "No")
Buggy python submission (verdict: Runtime Error):

S = input()

pritn("Yes" if S.count("A")==2 and S.count("B")==2 else "No")


Fixed submission:

S = input()

print("Yes" if S.count("A")==2 or S.count("B")==2 else "No")

Buggy python submission (verdict: Runtime Error):

S = input()

pritn("Yes" if S.count(A)==2 and S.count(B)==2 else "No")


Fixed submission:

S = input()

print("Yes" if S.count("A")==2 or S.count("B")==2 else "No")
Buggy python submission (verdict: Runtime Error):

ABC = set(input())

print("Yes" len(ABC)==2 else "No")


Fixed submission:

ABC = list(input().split())

print("Yes" if len(set(ABC))==2 else "No")

Buggy python submission (verdict: Runtime Error):

A, B, C = set(input().split())

print("Yes" len(A, B, C)==2 else "No")


Fixed submission:

ABC = list(input().split())

print("Yes" if len(set(ABC))==2 else "No")

Buggy python submission (verdict: Runtime Error):

A, B, C = set(input().split())

print("Yes" len(set)==2 else "No")


Fixed submission:

ABC = list(input().split())

print("Yes" if len(set(ABC))==2 else "No")
Buggy python submission (verdict: Runtime Error):
K, X = map(int, input())

print("Yes" if 500*K >= X else "No")


Fixed submission:
K, X = map(int, input().split())

print("Yes" if 500*K >= X else "No")
Buggy python submission (verdict: Runtime Error):

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

print("bust" if sum(A)>=22 else "win")


Fixed submission:

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

print("bust" if sum(A)>=22 else "win")
Buggy python submission (verdict: Runtime Error):
N = input()
S = input()

print("Yes" if S[0:(N//2)]==S[(N//2):N] else "No")


Fixed submission:
N = int(input())
S = input()

print("Yes" if S[:(N//2)] == S[(N//2):N] else "No")
Buggy python submission (verdict: Runtime Error):

N = int(input())

print(float(1/2) if (N%2)==0 else float((N+1)/2*N)

Fixed submission:
N = int(input())

print("0.5" if (N%2)==0 else ((N//2)+1)/N)
Buggy python submission (verdict: Runtime Error):

S = input()

weather = ["Sunny", "Cloudy", "Rainly"]
print(weather[(weather.index(S)+1)%3 ])


Fixed submission:

S = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(S)+1)%3])

Buggy python submission (verdict: Runtime Error):

S = input()

weather = ["Sunny", "Cloudy", "Rainly"]
print(weather[(weather.index(s)+1)%3])


Fixed submission:

S = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(S)+1)%3])
Buggy python submission (verdict: Runtime Error):

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

print("Yes" if max(a) ＜ sum(a)-max(a) else "No")


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

print("Yes" if max(a) < sum(a)-max(a) else "No")

Buggy python submission (verdict: Runtime Error):

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

print("Yes" if max(a) ＜ sum(a)-max(a) else "No")


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

print("Yes" if max(a) < sum(a)-max(a) else "No")

Buggy python submission (verdict: Runtime Error):

N = int(input())
a = [int(input()) for i in range(N)]

print("Yes" if max(a) > sum(a)-max(a) else "No")


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

print("Yes" if max(a) < sum(a)-max(a) else "No")
Buggy python submission (verdict: Runtime Error):
|AB|, |BC|, |CB| = map(int, input().split())
print(|AB|*|BC|//2)

Fixed submission:
AB, BC, CB = map(int, input().split())
print(AB*BC//2)
Buggy python submission (verdict: Runtime Error):

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [A-(T - i * 0.006) for i in H]

print(list.index(min(abs(list)))+1)


Fixed submission:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [abs(A-(T - i * 0.006)) for i in H]

print(list.index(min(list))+1)
Buggy python submission (verdict: Runtime Error):

A, B = map(int, input().splitz())

print(max(A+B, A-B, A*B))


Fixed submission:

A, B = map(int, input().split())

print(max(A+B, A-B, A*B))
Buggy python submission (verdict: Runtime Error):

a, b, c = input()

print("Yes" if set(a,b,c)==("a", "b", "c") else "No")


Fixed submission:

S = input()

print("Yes" if set(S)=={"a", "b", "c"} else "No")

Buggy python submission (verdict: Runtime Error):

a, b, c = input()

print("Yes" if set(a,b,c)=("a", "b", "c") else "No")


Fixed submission:

S = input()

print("Yes" if set(S)=={"a", "b", "c"} else "No")

Buggy python submission (verdict: Runtime Error):

S = input()

print("Yes" if set(S)=("a", "b", "c") else "No")


Fixed submission:

S = input()

print("Yes" if set(S)=={"a", "b", "c"} else "No")
Buggy python submission (verdict: Runtime Error):

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if X%(500*i + 100*j + 50*k) == 0 :
                count += 1

print(count)


Fixed submission:

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if X == 500*i + 100*j + 50*k :
                count += 1

print(count)

Buggy python submission (verdict: Runtime Error):

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if x%(500*i + 100*j + 50*k) == 0 :
                count += 1

print(count)


Fixed submission:

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if X == 500*i + 100*j + 50*k :
                count += 1

print(count)
Buggy python submission (verdict: Runtime Error):

A, B, C, D = map(int, input().split())

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)==(C+D) else "Right

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

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)==(C+D) else "Right")

Buggy python submission (verdict: Runtime Error):

A, B, C, D = map(int, input().split())

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)=(C+D) else "Right

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

print("Left" if (A+B)>(C+D) else "Balanced" if (A+B)==(C+D) else "Right")
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B)


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

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B))

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

print(sum(i for i in range(1,N+1)) if A<= sum(map(int, str(i))) <= B)

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

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B))
Buggy python submission (verdict: Runtime Error):
sss = input()
print(sss.count(1))


Fixed submission:
sss = input()
print(sss.count("1"))
Buggy python submission (verdict: Runtime Error):

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

count =0
while all(a%2 == 0 for a in A) :
    A = [a/2 in a in A]
    count = count + 1


print(count)


Fixed submission:

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

count =0
while all(a%2 == 0 for a in A) :
    A = [a/2 for a in A]
    count = count + 1


print(count)
Buggy python submission (verdict: Runtime Error):

N = input()

print("Yes" sum(map(int, N)) % int(N) == 0 else "No")


Fixed submission:

N = input()

print("Yes" if int(N) % sum(map(int, N)) == 0 else "No")
Buggy python submission (verdict: Runtime Error):

c = input()
d = input()

print("YES" c==c[::-1] and d==d[::-1] else "NO")


Fixed submission:

c = input()
d = input()

print("YES" if c==d[::-1] else "NO")