qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def hantei(n, m, l, d ):
    if (n*500+m*100+l*50)==d:
        print("n,m,l",n,m,l)
        return True
    return False

a = int(input()) #five
b = int(input()) #hund
c = int(input()) #fift
d = int(input()) #

n=m=l=0
result=0

while(n <= a):
    m=l=0
    while(m <= b):
        l=0
        while(l <= c):
            # print("n,m,l",n,m,l)
            if hantei(n,m,l,d)==True:
                result += 1
            l+=1
        if hantei(n,m,l,d)==True:
            result += 1
        m+=1
    if hantei(n,m,l,d)==True:
        result += 1
    n+=1

print(result)



Fixed code:
def hantei(n, m, l, d ):
    if (n*500+m*100+l*50)==d:
#        print("GO n,m,l",n,m,l)
        return True
    return False

a = int(input()) #five
b = int(input()) #hund
c = int(input()) #fift
d = int(input()) #

n=m=l=0
result=0

while(n <= a):
    while(m <= b):
        while(l <= c):
            # print("n,m,l",n,m,l)
            if hantei(n,m,l,d)==True:
                result += 1
            l+=1
        l=0
        # if hantei(n,m,l,d)==True:
        #     result += 1
        m+=1
    # if hantei(n,m,l,d)==True:
    #     result += 1
    m=l=0
    n+=1

print(result)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
t=0
for i in range(a+1):
  for j in range(c+1):
    for k in range(c+1):
      if 10*i+2*j+k==x/50:
        t+=1
print(t)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
t=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 10*i+2*j+k==x/50:
        t+=1
print(t)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
Y = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if i*500 + j*100 + k*50 == X:
                Y += 1
print(Y)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
Y = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i*500 + j*100 + k*50 == X:
                Y += 1
print(Y)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in A:
    for b in B:
        for c in C:
            if 500*(a+1)+100*(b+1)+50*(c+1) == X:
                ans += 1
print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for a in range(A+1) :
    for b in range(B+1) :
        for c in range(C+1) :
            if 500*a+100*b+50*c == X :
                ans += 1
print(ans)
Buggy code:
def main()
    a = int(input())
    b = int(input())
    c = int(input())
    tt = int(input())
    total = 0

    for yen500 in range(a+1):
        for yen100 in range(b+1):
            for yen50 in range(c+1):
                if yen500 * 500 + yen100 * 100 + yen50 * 50 == tt:
                    total += 1

    print(total)

main()

Fixed code:
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    tt = int(input())
    total = 0

    for yen500 in range(a+1):
        for yen100 in range(b+1):
            for yen50 in range(c+1):
                if yen500 * 500 + yen100 * 100 + yen50 * 50 == tt:
                    total += 1

    print(total)

main()
Buggy code:


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    
    ans = 0
    
    for n in range(a):
        for m in range(b):
            for l in range(c):
                if (500 * n + 100 * b + 50 * c) == x:
                    ans = ans + 1

    print(ans)
    


Fixed code:


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    ans = 0

    for n in range(a + 1):
        for m in range(b + 1):
            for l in range(c + 1):
                if (500 * n + 100 * m + 50 * l) == x:
                    ans = ans + 1

    print(ans)
Buggy code:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(C + 1):
            if 500 * A + 100 * B + 50 * C == X:
                count += 1
print(count)

Fixed code:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * i + 100 * j + 50 * k == X:
                count += 1
print(count)
Buggy code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
c=0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 500*a+100*b+50*c==X:
                c+=1
print(c)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for a in range(0, A+1):
  for b in range(0, B+1):
    for c in range(0, C+1):
      if a*500 + b*100 + c*50 == X:
        cnt += 1
        
print(cnt)
Buggy code:
A,B,C,X = [int(input()) for i in range(4)]
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500 * A + 100 * B + 50 * C == X:
                count += 1
print(count)

Fixed code:
A, B, C, X = map(int, [input() for i in range(4)])
ans = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i * 500 + j * 100 + k * 50 == X:
                ans += 1

print(ans)
Buggy code:
A, B, C = map(int, input().split())
X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)

Fixed code:
A = int(input())
B = int(input())
C = int(input())

X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)
Buggy code:
a = input()
b = input()
c = input()
x = input()

cnt = 0
for i in range(a + 1):
	if 500 * i <= x:
		p = x - 500 * i
		for j in range(b + 1):
			if 100 * j <= p:
				q = p - 100 * j:
				for k in range(c + 1):
					if q - 50 * k == 0:
						cnt += 1

print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a + 1):
	if 500 * i <= x:
		p = x - 500 * i
		for j in range(b + 1):
			if 100 * j <= p:
				q = p - 100 * j
				for k in range(c + 1):
					if q - 50 * k == 0:
						cnt += 1

print(cnt)
Buggy code:
a = int(input())+1
b = int(input())+1
c = int(input())+1
x = int(input())

counter = 0

for _a in range(a):
    for _b in range(b):
        for _c in range(c):
            ans = 500*_a + 100*_b + 50*_c
            if ans == x:
                counter += 1

Fixed code:
a = int(input())+1
b = int(input())+1
c = int(input())+1
x = int(input())

counter = 0

for _a in range(a):
    for _b in range(b):
        for _c in range(c):
            ans = 500*_a + 100*_b + 50*_c
            if ans == x:
                counter += 1

print(counter)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  　　for b in range(B+1):
    　　　　for c in range(C+1):
      　　　　　　value = 500*a + 100*b + 50*c 
      　　　　　　if value == X :
        　　　　　	ans += 1
        　　　　　	print(a, b, c)
        

print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      value = 500*a + 100*b + 50*c 
      if value == X:
      	ans += 1
print(ans)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
result=0
for p in range(a):
  for q in range(b):
    for r in range(c):
      if p*500+q*100+r*50==x:
        result+=1
print(result)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
result=0
for p in range(a+1):
  for q in range(b+1):
    for r in range(c+1):
      if p*500+q*100+r*50==x:
        result+=1
print(result)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for a in range(1, A+1):
  for b in range(1, B+1):
    for c in range(1, C+1):
      if 500*a + 100*b + 50*c == X:
        ans += 1
print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a + 100*b + 50*c == X:
        ans += 1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0

for i in range(a):
    for j in range(b):
        for k in range(c):
            total = 500 * i + 100 * j + 50 * k
            if total == x:
                counter += 1

print(counter)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0

for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            total = (500 * i) + (100 * j) + (50 * k)
            if total == x:
                counter += 1

print(counter)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if (500*a)+(100*b)+(50*c) == x:
        res += 1

print(res)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ans += 1

print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if (500*a)+(100*b)+(50*c) == x:
        res += 1
else:
  print(res)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if (500*i)+(100*j)+(50*k) == x:
        res += 1

print(res)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 500*i + 100*i + 50*k == X:
        res += 1
print(res)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
ans=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i+100*j+50*k==X:
                ans+=1
print(ans)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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


Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
ans =0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      tmp = 500*i + 100*j + 50*k
      if X == tmp: 
        ans +=1
print(ans)
Buggy code:
A, B, C, D = [int(input()) for i in range(4)]
print(A)
ans=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            tmp = i * 500 + j * 100 +50 *k
            if(tmp == D):
                ans += 1
print(ans)

Fixed code:
A, B, C, D = [int(input()) for i in range(4)]
ans=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            tmp = i * 500 + j * 100 +50 *k
            if(tmp == D):
                ans += 1
print(ans)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
y=0
d=0
s=0
t=0
u=0
for i in range(a+1):
    t=0
    u=0
    if s==0: 
        y=500*i
        if x < y:
            s =1
        else:
            for j in range(b+1):
                u=0
                if t==0:
                    y=500*i+100*j
                    if x < y:
                        t=1
                    else:
                        for k in range(c+1):
                            if u==0:
                                y=500*i+100*j+50*k
                                if x==y:
                                    d=d+1
                                    u=1
                                    print(i,j,k)
print(str(d))
                
            


Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
y=0
d=0
s=0
t=0
u=0
for i in range(a+1):
    t=0
    u=0
    if s==0: 
        y=500*i
        if x < y:
            s =1
        else:
            for j in range(b+1):
                u=0
                if t==0:
                    y=500*i+100*j
                    if x < y:
                        t=1
                    else:
                        for k in range(c+1):
                            if u==0:
                                y=500*i+100*j+50*k
                                if x==y:
                                    d=d+1
                                    u=1
print(str(d))
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  A=i*500
  for j in　range(b+1):
    B=j*100
    for k in range(c+1):
      C=k*50
      
      if A+B+C=x:
        ans+=1
print(ans)


Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  A=i*500
  for j in range(b+1):
    B=j*100
    for k in range(c+1):
      C=k*50
      
      if A+B+C==x:
        ans+=1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
num = []
for a_ in range(a+1):
    for b_ in range(b+1):
        for c_ in range(c+1):
            cal = a_ * 500 + b_ * 100 + c_ * 50
            num.append(cal)
print(num.count(6000))

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
num = []
for a_ in range(a+1):
    for b_ in range(b+1):
        for c_ in range(c+1):
            cal = a_ * 500 + b_ * 100 + c_ * 50
            num.append(cal)
print(num.count(x))
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k==x
      ans+=1
      
print(ans)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k == x:
                cnt+=1
print(cnt)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A):
  for j in range(B):
    for k in range(C):
      if 500*i + 100*j + 50*k = X:
        n += 1
print(n)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0

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

print(cnt)
Buggy code:
a_500 = int(input())
b_100 = int(input())
c_50 = int(input())
kadai = int(input())
sum_coin = 0
count = 0
sum_list = []

for n in range(a_500 + 1):
    sum_coin = (n * 500)
    for m in range(b_100 + 1):
        sum_coin = sum_coin + (100 * m)
        for l in range(c_50 + 1):
            sum_coin = sum_coin + (50 * l)
            sum_list.append(sum_coin)
            sum_coin = 0 + (100 * n) + (500 * m)
print(sum_list.count(kadai))

Fixed code:
a_500 = int(input())
b_100 = int(input())
c_50 = int(input())
kadai = int(input())
sum_coin = 0
count = 0
sum_list = []

for n in range(a_500 + 1):
    for m in range(b_100 + 1):
        for l in range(c_50 + 1):
            sum_list.append((500*n) + (100*m) + (50*l))
print(sum_list.count(kadai))
Buggy code:
a,b,c,x=map(int,[input() for i in range(4)])
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j+100+k*50==x:
                ans+=1
print(ans)

Fixed code:
a,b,c,x=map(int,[input() for i in range(4)])
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j*100+k*50==x:
                ans+=1
print(ans)
Buggy code:
A, B, C, X = [int(input()) for i in range(4)]

res = 0
for a in range(A):
	for b in range(B):
		for c in range(C):
			total = 500 * a + 100 * b + 50 * c
			if total == X:
				res += 1
print(res)

Fixed code:
A, B, C, X = [int(input()) for i in range(4)]
count = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c == X:
        count += 1
print(count)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            ans = i*500 + j*100 + k*50
            if ans == x:
                cnt += 1

print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

number_of_combination = 0


for k in range(0,A+1):
    number_of_c = k
    for j in range(0,B+1):
        number_of_b = j
        for i in range(0,C+1):
            number_of_a = i
            sum = 500*number_of_a + 100*number_of_b + 50*number_of_c
            if sum == int(X):
                number_of_combination += 1

print(number_of_combination)


Fixed code:

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

number_of_combination = 0


for k in range(0,A+1):
    number_of_a = k
    for j in range(0,B+1):
        number_of_b = j
        for i in range(0,C+1):
            number_of_c = i
            sum = 500*number_of_a + 100*number_of_b + 50*number_of_c
            if sum == X:
                number_of_combination += 1

print(number_of_combination)
Buggy code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

a = int(input())
b = int(input())
c = int(input())
x = int(input())

sum = 0
cnt = 0
for i in range(a):
    sum += 500*i
    for j in range(b):
        sum += j*100
        for k in range(c):
            sum += 50*k
            
            if sum == x:
                cnt += 1
                sum = 0
            else:
                sum = 0
print(cnt)


Fixed code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

a = int(input())
b = int(input())
c = int(input())
x = int(input())


cnt = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j*100+k*50 == x:
                cnt += 1
print(cnt)
Buggy code:
li = [int(input()) for i in range(4)]
counter = 0
for p in range(li[0]+1):
  for q in range(li[1]+1):
    for r in range(li[2]+1):
      if 500*p+100*q+r == li[3]:
        counter+=1
print(counter)       

Fixed code:
li = [int(input()) for i in range(4)]
counter = 0
for p in range(li[0]+1):
  for q in range(li[1]+1):
    for r in range(li[2]+1):
      if 500*p+100*q+50*r == li[3]:
        counter+=1
print(counter)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for B in range(b+1) for C in range(c+1) if (x-(100*B)-(50*C))%500==0]))

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for B in range(b+1) for C in range(c+1) if (x-(100*B)-(50*C))%500==0 and (x-(100*B)-(50*C))>=0 and (x-(100*B)-(50*C))<=500*a]))
Buggy code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
c=0
count = 0
while a*500<=X:
    while b*100<=X:
        while b*100+c * 50 <=X:
            if b*100+c*50==X:
                #print(a,b,c)
                count+=1
                break
            else:
                #print(b,c)
                c+=1
        c=0
        b+=1
        #print(b,c)
    a+=1
    b=0
    c=0
'''
while a * 500 <=X and a < A:
    while a * 500+ b * 100 <= X and b < B:
        while a * 500 + b * 100 + c * 50 <= X and c < C:
            if(a * 500 + b * 100 + c * 50 == X):
                count+=1
                c=0
                break
            elif(a * 500 + b * 100 + c * 50 >X):
                break
            else:
                print(c)
                c+=1
        b+=1
    a+=1
'''
print(count)


Fixed code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
c=0
count = 0
while a*500<=X and a<=A:
    while a*500+b*100<=X and b<=B:
        while a*500+b*100+c * 50 <=X and c<=C:
            if a*500+b*100+c*50==X:
                #print(a,b,c)
                count+=1
                break
            else:
                #print(a,a,b,c)
                c+=1
        c=0
        b+=1
        #print(b,c)
    a+=1
    b=0
    c=0
    #print(a,b,c)
print(count)
Buggy code:
c500 = int(input())
c100 = int(input())
c500 = int(input())
t = int(input())
s = 0

for a in range(0, c500 + 1):
    for b in range(0, c100 + 1):
        for c in range(0, c50 + 1):
            if 500*a + 100*b + 50*c == t:
                s = s + 1
print(s)


Fixed code:
c500 = int(input())
c100 = int(input())
c50 = int(input())
t = int(input())
s = 0

for a in range(0, c500 + 1):
    for b in range(0, c100 + 1):
        for c in range(0, c50 + 1):
            if 500*a + 100*b + 50*c == t:
                s = s + 1
print(s)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0
for i in range(0, A):
    for n in range(0, B):
        for t in range(0, C):
            total = 500 * A + 100 * B + 50 * C
            if total == X:
                counter += 1
print(counter)     

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0
for i in range(0, A+1):
    for n in range(0, B+1):
        for t in range(0, C+1):
            total = 500 * i + 100 * n + 50 * t
            if total == X:
                counter += 1
print(counter)
Buggy code:
A = input()
B = input()
C = input()
X = input()

ans = 0
for a in A:
    for b in B:
        for c in C:
            total = (500 * a) + (100 * b) + (50 * c)
            if total == X:
                ans += 1
print(ans)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
ans=0
for a in range(A+1):
	for b in range(B+1):
		for c in range(C+1):
			total=500*a+100*b+50*c
			if total==X:
				ans+=1
 
print(ans)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*A + 100*B + 50*C
				answer++
print(answer)


Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

c = 0

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

print(c)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for i in range(b+1) for j in range(c+1) if (x-100*i-50*j)%500==0 and 0<=x-100*i-50*j<=a]))

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for i in range(b+1) for j in range(c+1) if (x-100*i-50*j)%500==0 and 0<=(x-100*i-50*j)/500<=a]))
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
nb = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      (x - 500*i - 100*j - 50*k) == 0:
      nb += 1
print(nb)
      

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
nb = 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:
        nb += 1
print(nb)