qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for a in range(A):
  for b in range(B):
    for c in range(C):
      if X == 500*a + 100*b + 50*c:
        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 X == 500*a + 100*b + 50*c:
        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*1 + 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 = map(int, input())
b = map(int, input())
c = map(int, input())
x = map(int, input())

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

print(num)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
num = 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:
        num += 1
 
print(num)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
num = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      if 500 * i + 100 * j + 50 * k == x:
        num += 1
 
print(num)

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 x == 500*i+100*j+50*k:
                count += 1
print(count)
Buggy code:
abc = [int(input()) for x in range(3)]
x = int(input())
cnt = 0
for i in range(abc[2]+1):
    for j in range(abc[1]+1):
        for k in range(abc[0]+1):
            if x == 500*i+100*j+50*k:
                cnt += 1
print(cnt)

Fixed code:
abc = [int(input()) for x in range(3)]
x = int(input())
cnt = 0
for i in range(abc[0]+1):
    for j in range(abc[1]+1):
        for k in range(abc[2]+1):
            func = 500*i+100*j+50*k
            if func == x : cnt += 1
            else: continue
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 = input() # 500
b = input() # 100
c = input() # 50
x = input() # objecive

counter = 0
for use_a in range(a+1):
  if 500*use_a > x:
    continue
  rest = x - 500*use_a
  for use_b in range(b+1):
    if 100*use_b > rest:
      continue
    rest = rest - 100*use_b
    for use_c in range(c+1):
      if 50*use_c != rest:
        continue
      counter += 1

print(counter)


Fixed code:
a = int(input())  # 500
b = int(input())  # 100
c = int(input())  # 50
x = int(input())  # objecive

counter = 0
for use_a in range(a + 1):
    if 500 * use_a > x:
        continue
    rest = x - 500 * use_a
    for use_b in range(b + 1):
        if 100 * use_b > rest:
            continue
        rest_c = rest - 100 * use_b
        for use_c in range(c + 1):
            if 50 * use_c != rest_c:
                continue
            counter += 1

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

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):
            x =  500 * a + 100 * b + 50 * c
            if x == X:
                ans += 1

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

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

count = 0
for fi in range(0, arr[0]):
    for hun in range(0, arr[1]):
        for fifty in range(0, arr[2]):
            sum = int(fi) * 500 + int(hun) * 100 + int(fifty) * 50
            if sum == arr[3]:
                count += 1
print(count)

Fixed code:
arr = [input() for i in range(4)]

count = 0
for fi in range(0, int(arr[0])+1):
    for hun in range(0, int(arr[1])+1):
        for fifty in range(0, int(arr[2])+1):
            sum = fi * 500 + hun * 100 + fifty * 50
            if sum == int(arr[3]):
                count += 1
print(count)
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):
            if (X== 500*i +100*j +50*k):
                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 (X== 500*i +100*j +50*k):
                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+1):
  for j in range(b+1):
    for k in range(c+1):
      if i * 50 + j * 100 + k * 500 == x:
        ans += 1
print(ans)

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

z = 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:
        z += 1
print(z)
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 i*500+j*100+k*50 == 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())
cnt=0

for i in range(0,A+1):
  for j in range(0,B+1):
    for k in range(0,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())
cnt=0

for i in range(0,A+1):
  for j in range(0,B+1):
    for k in range(0,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())

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

print(count)
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):
      x = 500*i+100*j+50*k
      if X == 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(A+1):
  for j in range(B+1):
    for k in range(C+1):
      x = 500*i+100*j+50*k
      if X == x:
        counter += 1
print(counter)
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):
      tt = i*500 + j*100 + k*50
      if tt is 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=[]
for i in range(3):
    a.append(int(input()))
x=int(input())
ans+=1

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

Fixed code:
a=[]
for i in range(3):
    a.append(int(input()))
x=int(input())
ans=0

for i in range(a[0]+1):
    for j in range(a[1]+1):
        for k in range(a[2]+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())
s = 0
n = 0
counter = 0

for i in range(a):
  for j in range(b):
    for k in range(c):
      s = 500*i + 100*j + 50*k
      if s == x:
        counter += 1
      
for s in range(c):
  for t in range(b):
    for u in range(a):
      n = 50*s + 100*t + 500*u
      if n == x:
        counter += 1
        
print(counter)

Fixed code:
a = int(input());b = int(input());c = int(input());x = int(input())
s = 0
n = 0
counter = 0

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

print(counter)
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):
      t = i*500 + j*100 + k*50
      if t is x:
        ans = 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):
      t = (i*500) + (j*100) + (k*50)
      if t == x:
        ans = ans + 1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0
for i_a in range(a+1):
    sum_a = 500 * i_a
    print(i_a)
    for i_b in range(b+1):
        sum_b = 100 * i_b
        for i_c in range(c+1):
            sum_c = 50 * i_c
            if x == (sum_a + sum_b + sum_c):
                count += 1

print(count)

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

count = 0
for i_a in range(a+1):
    sum_a = 500 * i_a
    for i_b in range(b+1):
        sum_b = 100 * i_b
        for i_c in range(c+1):
            sum_c = 50 * i_c
            if x == (sum_a + sum_b + sum_c):
                count += 1

print(count)
Buggy code:
import sys
input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B, C, X = [int(input()) for _ in range(4)]
        ans = 0
        for a in range(A):
            for b in range(B):
                for c in range(C):
                    if 500*a+100*b+50*c == X:
                        ans +=1
        print(ans)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Fixed code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B, C, X = [int(input()) for _ in range(4)]
        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)


# Run main
if __name__ == '__main__':
    AtCoder().main()
Buggy code:
list_500 = list(range(A+1))
list_100 = list(range(B+1))
list_50 = list(range(C+1))

for fh in range(len(list_500)):
    for oh in range(len(list_100)):
      for f in range(len(list_50)):
        if list_500[fh] * 500 + list_100[oh] * 100 + list_50[f] * 50 == X:
          counter += 1

print(counter)

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

list_500 = list(range(A+1))
list_100 = list(range(B+1))
list_50 = list(range(C+1))

for fh in range(len(list_500)):
    for oh in range(len(list_100)):
      for f in range(len(list_50)):
        if list_500[fh] * 500 + list_100[oh] * 100 + list_50[f] * 50 == X:
          counter += 1

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

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

count = 0

for i_a in range(a):
  for i_b in range(b):
    for i_c in range(c):
      if 500*a + 100*b + 50*c == x:
        count += 1
        
print(count)

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

count = 0

for i_a in range(a + 1):
  for i_b in range(b + 1):
    for i_c in range(c + 1):
      if 500*i_a + 100*i_b + 50*i_c == 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*a+100*b+50*c==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())
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):
            total = 500*i+100*j+k*50
            if total == x:
                cnt+=1
print(cnt)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

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

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

count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if h *500 + i *100 + j *50 == x:
                count += 1
print(count)
Buggy code:
A, B, C, X = map(int, [input() for i in  range(4)])
counter = 0
numA=min(X//500, A)
for a in range(0,numA+1):
    numB=min((X-500*a)//100,B)
    for b in range(0, numB+1):
        for c in range(0, C+1):
            if (X-500*a-100*b)-50*c==0:
                counter+=1
                print(a,b,c)
print(counter)

Fixed code:
A, B, C, X = map(int, [input() for i in  range(4)])
counter = 0
numA=min(X//500, A)
for a in range(0,numA+1):
    numB=min((X-500*a)//100,B)
    for b in range(0, numB+1):
        for c in range(0, C+1):
            if (X-500*a-100*b)-50*c==0:
                counter+=1
print(counter)
Buggy code:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a):
    if x - (500 * i) >= 0:
        x_ = x - (500 * i)
        for j in range(b):
            if x_ - (100 * j) >= 0:
                x_ = x - (100 * j)
                for k in range(c):
                    if x_ - (50 * k) == 0:
                        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):
    if x - (500 * i) >= 0:
        x_0 = x - (500 * i)
        for j in range(b + 1):
            if x_0 - (100 * j) >= 0:
                x_1 = x_0 - (100 * j)
                for k in range(c + 1):
                    if x_1 - (50 * k) == 0:
                        ans += 1
print(ans)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cou = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if 500 * i + 100 * j + 50 * k == X:
                cou += 1
print(cou)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cou = 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:
                cou += 1
print(cou)
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 500*a + 100*b + 50*c == X:
                m+=1
print(m)

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

counts = 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:
                counts += 1
                
print(counts)

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:
gohya =int(input())
hya = int(input())
goju = int(input())
total = int(input('total'))
count = 0
for gh in range(gohya+1):
	for hy in range(hya+1):
		for gj in range(goju+1):
			if 500*gh + 100*hy + 50*gj == total:
				count += 1
print(count)

Fixed code:
gohya =int(input())
hya = int(input())
goju = int(input())
total = int(input())
count = 0
for gh in range(gohya+1):
	for hy in range(hya+1):
		for gj in range(goju+1):
			if 500*gh + 100*hy + 50*gj == total:
				count += 1
print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(0, A + 1):
  for j in range(0, B + 1):
    for k in range(0, C + 1):
      if i * 500 + j * 100 + k * 50 == X:
        ans
        
print(ans)

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

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

total = 0
ans = 0
for i in range(a):
    for j in range(b):
        for k in range(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())

total = 0
ans = 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:
                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

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:
# -*- coding:utf-8 -*-

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

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

Fixed code:
# -*- coding:utf-8 -*-

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,B,C,X = map(int, open(0).read().split())

ans = 0

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

ans

Fixed code:
A,B,C,X = map(int, open(0).read().split())

ans = 0

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

print(ans)
Buggy code:
from collections import defaultdict, Counter
from heapq import heapify, heappop, heappush
from sys import stdin

def main():
    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+50*b+10*c == x:
                    ans += 1
    print(ans)

input = lambda: stdin.readline().rstrip()
main()

Fixed code:
from collections import defaultdict, Counter
from heapq import heapify, heappop, heappush
from sys import stdin

def main():
    A = int(input())
    B = int(input())
    C = int(input())
    x = int(input())

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

input = lambda: stdin.readline().rstrip()
main()
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

num = 0
for i in range(0,A+1):
    for ii in range(0,B+1):
        for iii in range(0,C+1):
            t = i*500 + ii*100 + iii*50
            print(t)
            if t ==X:
                num+=1
print(num)

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

num = 0
for i in range(0,A+1):
    for ii in range(0,B+1):
        for iii in range(0,C+1):
            t = i*500 + ii*100 + iii*50
            if t ==X:
                num+=1
print(num)