qyliang/CodeNanoFix huggingface dataset:
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):
            if 500 * i + 100 * j + 50 * k == x:
                ans += 1
print(ans)                


Fixed code:
# Coins
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 i * 500 + j * 100 + k * 50 == x:
                ans += 1

print(ans)
Buggy code:
A, B, C, X = [int(input()) for i in range(4)]
print(sum(500*a + 100*b + 50*c == X for a in range(A+1) and b in range(B+2) and c in range(C+1)))

Fixed code:
A, B, C, X=[int(input()) for i in range(4)]
print(sum(500*a + 100*b + 50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))
Buggy code:
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):
        if x <= i*500 + j*100 + c*50:
            count += 1
print(count)

Fixed code:
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 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())
s=0
for i in range(51):
  for j in range(51):
    for k in range(51):
      if x==500*i+100*j+50*k:
        s=s+1

print(s)        

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

print(s)
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):
      if(500*i+100*j+50*k == X):
        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) :
    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, 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):
            in 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)])
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,b,c,x = [int(input() for _ 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 = [int(input()) for _ 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 _ in range(4)]
print(len([1 for i in range(a+1) for j in range(b+1) if (x-500*a-100*b)%50==0 and 0<=(x-500*a-100*b)//50 <=c]))


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

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

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

count = 0
for a in range (A+1):
    for b in range (B+1):
        for c in range (C+1):
            if a*500 + b*100 + c*50 == X:
                count += 1
print(count)
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):
      if (a * 500 + b* 100 + c * 50 == 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):
  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 = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0

for ai in range(a):
    for bi in range(b):
        for ci in range(c):
            amount = 500 * ai + 100 * bi + 50 * ci
            if amount == x:
                ans += 1

print(ans)

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

ans = 0

for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            amount = 500 * ai + 100 * bi + 50 * ci
            if amount == x:
                ans += 1

print(ans)
Buggy code:
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 500 * i + 100 * j + 50 * k == x:
                count += 1

Fixed code:
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 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())
counter=0
for i1 in range(a):
  for i2 in range(b):
    for i3 in range(c):
      if 500*i1+100*i2+50*i3==x:
        counter+=1
print(counter)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
counter=0
for i1 in range(0,a+1):
  for i2 in range(0,b+1):
    for i3 in range(0,c+1):
      if 500*i1+100*i2+50*i3==x:
        counter=counter+1
print(counter)
Buggy 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
ans(cnt)

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())

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)

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 = input()
B = input()
C = input()
X = input()
count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            x = (a*500) + (b*100) + (c*50)
            if x == X:
                count += 1
print(count)
    

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

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

for i in range(1,a+1):
  for j in range(1,b+1):
    for k in range(1,c+1):
      y = i*500 + j*100 + k*50
      if x == y:
        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):
            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())
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            total = i*500+j*100+k*50
            if total == x:
                count += 1
            else: print('a')
print(count)

Fixed code:
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):
      total=500*i+100*j+50*k
      if total==x:
        count+=1
print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ret = 0
for i in range(X / A + 1):
  for j in range((X - i * 500) / B + 1):
    for k in range((X - i * 500 - j * 100) / C + 1):
      if i * 500 + j * 100 + k + 50 == x:
        ret += 1
print(ret)

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

ret = 0
for i in range(int(min(X / 500, A) + 1)):
  for j in range(int(min((X - i * 500) / 100, B) + 1)):
    for k in range(int(min((X - i * 500 - j * 100) / 50, C) + 1)):
      if i * 500 + j * 100 + k * 50 == X:
        ret += 1
print(ret)
Buggy code:
a, b, c, x = [int(input()) for _ in range(4)]
ans = 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:
        ans += 1
prit(ans)

Fixed code:
a, b, c, x = [int(input()) for _ in range(4)]
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())
count = 0

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

print(count)

Fixed code:
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):
            sum = 500*i + 100*j + 50*k
            if x == sum:
                count += 1

print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0

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

print(cnt)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 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:
                cnt += 1

print(cnt)
Buggy code:
a,b,c,x = open(0)
d=0
x = int(x)

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

      

Fixed code:
a,b,c,x = open(0)
d=0
x = int(x)
 
for i in range(int(a)+1):
  for j in range(int(b)+1):
    for k in range(int(c)+1):
      if  500*i + 100*j + 50*k == x:
        d += 1
     
      
print(d)
Buggy code:
a, b, c, x = [int(input()) for _ in range(4)]
cnt = 0
for ai in range(a):
	for bi in range(b):
		for ci in range(c):
        	if 500*ai + 100*bi + 50*ci == x:
            	cnt += 1
print(cnt)

Fixed code:
a, b, c, x = [int(input()) for _ in range(4)]
cnt = 0
for ai in range(0, a+1):
    for bi in range(0, b+1):
        for ci in range(0, c+1):
            if 500*ai + 100*bi + 50*ci == x:
                cnt += 1
print(cnt)
Buggy 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)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
m=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:
        m+=1
print(m)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

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

print(count)

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

count = 0
for k in range(a+1):
    for j in range(b+1):
        for i in range(c+1):
            total = 500*k + 100*j + 50*i
            if total == x:
                count += 1
print(count)
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):
      if 500*i+100+j+50*k==X:
        ans++
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):
      if 500*i+100*j+50*k==X:
        ans+=1
print(ans)
Buggy code:
a=input()
b=input()
c=input()
x=input()
ans=0
for i in range(a):
  for j in range(b):
    for k in range(c):
      if x==500*i+100*j+50*k:
        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):
      if x==500*i+100*j+50*k:
        ans+=1
print(ans)
Buggy code:
a_500 = int(input().split()[0])
b_100 = int(input().split()[0])
c_50 = int(input().split()[0])
x = int(input().split()[0])

all_coins = []
count = 0

for a_n in range(a_500+1):
    for b_n in range(b_100+1):
        for c_n in range(c_50+1):
            hoge = 500*a_n + 100*b_n + 50*c_50
            if hoge == x:
                count += 1

print(count)

Fixed code:
a_500 = int(input().split()[0])
b_100 = int(input().split()[0])
c_50 = int(input().split()[0])
x = int(input().split()[0])

all_coins = []
count = 0

for a_n in range(a_500+1):
    for b_n in range(b_100+1):
        for c_n in range(c_50+1):
            total = 500*a_n + 100*b_n + 50*c_n
            if total == x:
                count += 1

print(count)
Buggy code:
C500 = int(input())
C100 = int(input())
C50 = int(input())
X = int(input())
count = 0
for i in range(C500):
  for j in range(C100):
    for k in range(C50):
      TOTAL = 500*i+100*j+50*k
      if TOTAL == X:
        count += 1
        break
print(count)

Fixed code:
C500 = int(input())
C100 = int(input())
C50 = int(input())
X = int(input())
count = 0
for i in range(C500+1):
  for j in range(C100+1):
    for k in range(C50+1):
      TOTAL = 500*i+100*j+50*k
      if TOTAL == X:
        count += 1
        break
print(count)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
q=int(input())
ans=0
for i in range(a):
  for i in range(b):
    for i in range(c):
      if 500*a+100*b+50*c==q:
        ans+=1
print(ans)

Fixed code:
a=int(input())
b=int(input())
c=int(input())
q=int(input())
ans=0
for i in range(a+1):
  for k in range(b+1):
    for p in range(c+1):
      if 500*i+100*k+50*p==q:
        ans+=1
print(ans)
Buggy code:
a = int(input().strip())
b = int(input().strip())
c = int(input().strip())
x = int(input().strip())

count = 0
for a_n in range(a):
    for b_n in range(b):
        for c_n in range(c):
            if x - (a_n * 500) - (b_n * 100) - (c_n * 50) is 0:
                count += 1
            else:
                continue

print(count)

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

if a * 500 + b *100 + c * 50 < x:
    print(0)
else:
    count = 0
    for a_n in range(a+1):
        for b_n in range(b+1):
            for c_n in range(c+1):
                if (a_n * 500) + (b_n * 100) + (c_n * 50) == x:
                    count += 1
                else:
                    continue
    print(count)
Buggy code:
a,b,c,x = map(int,[input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                count = count + 1
print(count)

Fixed code:
a, b, c, x = map(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 i*500 + j*100 + k*50 == x:
                count+=1
print(count)
Buggy code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
out=0
for i in range(A):
    for j in range(B):
        for k in range(C):
            sum = i*500 + B*100 + C*50
            if sum==X:
                out+=1
print(out)

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

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

print(cnt)

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

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

print(cnt)
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())
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+1):
  for j in range(B+1):
    for k in range(C+1):
      if 50*i + 100*j = 500*k == X:
        ans += 1
print(ans)

Fixed code:

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 500*i + 100*j + 50*k == X:
                count += 1
print(count)
Buggy code:
def read_plus_1():
    return(int(input())+1)


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

count = 0
for i in range(0, a):
    if i * 500 > x:
        continue
    for j in range(0, b):
        if i * 500 + j * 100 > x:
            continue
        for k in range(0, c):
            print(i * 500 + j * 100 + k * 50)
            if i * 500 + j * 100 + k * 50 == x:
                count += 1
                break
print(count)


Fixed code:
def read_plus_1():
    return(int(input())+1)


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

count = 0
for i in range(0, a):
    if i * 500 > x:
        continue
    for j in range(0, b):
        if i * 500 + j * 100 > x:
            continue
        for k in range(0, c):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1
                break
print(count)
Buggy code:
import itertools

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

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

print(count)




Fixed code:
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):
            price = i*500 + j*100 + k*50 
            if price == X:
                count += 1
            price = 0
 
print(count)
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*j + 50*k == X:
              	res + = 1
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())

ans = 0

for i in range(a):
    for j in range(b):
        for k in range(c):
            t = 500*i + 100*j + 50*k
            if t == 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):
    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())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m > x:
        break
      elif m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
    if m > x:
      break
  i2 = 0
  i1 += 1
  if m > x:
    break
print(p)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m > x:
        break
      elif m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)
Buggy code:

b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m, p = 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m1, m2, m3, p = 0, 0, 0, 0
while i1 <= a:
  m1 = 500 * i1
  while i2 <= b:
    m2 = m1 + 100 * i2
    while i3 <= c:
      m3 = m2 + 50 * i3
      print(str(i1) + str(i2) + str(i3) + str(m3))
      if m3 < x:
        i3 += 1
        continue
      elif m3 > x:
        break
      else:
        p += 1
        break
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m1, m2, m3, p = 0, 0, 0, 0
while i1 <= a:
  m1 = 500 * i1
  while i2 <= b:
    m2 = m1 + 100 * i2
    while i3 <= c:
      m3 = m2 + 50 * i3
      if m3 < x:
        i3 += 1
        continue
      elif m3 > x:
        break
      else:
        p += 1
        break
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)
Buggy 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*a+100*b+50*c == x:
        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):
  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())
p = 0
for i in range(A):
  for j in range(B):
    for k in range(C):
      if 500*(i+1) + 100*(j+1) + 50*(k+1) == X:
        p = p + 1
print(p)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
p = 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:
        p = p + 1
print(p)
Buggy code:
a, b, c, x = [int(input()) for i in range(4)]

can_count = 0

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

print(can_count)

Fixed code:
a, b, c, x = [int(input()) for i in range(4)]

can_count = 0

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

print(can_count)