qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
for a500 in range(A + 1):
    for b100 in range(B + 1):
        for c50 in range(C + 1):
            if a500 * 500 + b100 * 100 + c50 * 50 = X:
                res += 1
print(res)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
for a500 in range(A + 1):
    for b100 in range(B + 1):
        for c50 in range(C + 1):
            if a500 * 500 + b100 * 100 + c50 * 50 == 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 + 1):
  for j in range(b + 1):
    ts = i * 500 + j * 100
    if x - ts >= 0 and (a - ts) % 50 == 0 and (a - ts) // 50 <= c:
      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):
    ts = i * 500 + j * 100
    if x - ts >= 0 and (x - ts) % 50 == 0 and (x - ts) // 50 <= c:
      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 X == A * i * 500 + B * j * 100 + C * k * 50: 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 X == i * 500 + j * 100 + k * 50: res += 1
print(res)
Buggy code:
a=input()
b=input()
c=input()
x=input()
t=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:
        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 500*i+100*j+50*k==x:
        t+=1
print(t)
Buggy code:
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


A = I()
B = I()
C = I()
X = I()
ans = 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:
                ans += 1
print(ans)


Fixed code:
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


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

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())
print([0 <= X - 500*a - 100*b and X - 500*a - 100*b %
       50 == 0 and X - 500*a - 100*b // 50 <= C for a in A for b in B].count(True))


Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
print([0 <= X - 500*a - 100*b and (X - 500*a - 100*b) %
       50 == 0 and (X - 500*a - 100*b) // 50 <= C for a in range(A+1) for b in range(B+1)].count(True))
Buggy 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(c)


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=int(input())
B=int(input())
C=int(input())
X=int(input())

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

print(c)


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

c = 0
ans = 0

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

counter = 0

for i in range(0, A):
    for j in range(0, B):
        remain_num = X - (i * 500 + j * 100)
        divisible = (remain_num % 50 == 0)

        if divisible and (remain_num / 50) > 0:
            counter += 1

print(counter)


Fixed code:
A, B, C, X = [int(input()) for i in range(4)]

counter = 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:
                counter += 1

        # remain_num = X - (i * 500 + j * 100)
        # divisible = (remain_num % 50 == 0)
        #
        # if divisible and (remain_num / 50) > 0:
        #     counter += 1

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

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

print(pattern)

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

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

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

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

print(pattern)

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

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

for a in range(A+1):
    a_total=a*500
    for b in range(B+1):
        b_total=b*100
        for c in range(C+1):
            c_total=c*50
            total_amount=(a_total+b_total+c_total)
            if X==total_amount:
                count=counter+1
print(count)

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

for a in range(A+1):
    a_total=a*500
    for b in range(B+1):
        b_total=b*100
        for c in range(C+1):
            c_total=c*50
            total_amount=(a_total+b_total+c_total)
            if X==total_amount:
                counter=counter+1
print(counter)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for a in A:
  for b in B:
    for c in C:
      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=["","",""]
for i in range(3):
    a[i]=int(input())
x=int(input())
cnt=0
for i in range(a[0]+1):
    print("----i="+str(i))
    for j in range(a[1]+1):
        print("----j="+str(j))
        
        for k in range(a[2]+1):
            ans = x-500*i - 100*j - 50*k
            print("----k="+str(k) + str(ans))
            if ans==0:
                cnt+=1
print(cnt)

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

count = 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:
                count+=1
                
print(count)
Buggy code:
A=int(input())
B=int(input())
C=int(input())
N=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+C*k== N:
                     count+=1
print(count)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
N=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== N:
                     count+=1
print(count)
Buggy code:
a,b,c,x=map(int,open(0).read().split())
cnt=0
#O(n**3)=O(50**3)=O(125000)
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,b,c,x=map(int,open(0).read().split())
cnt=0
#O(n**3)=O(50**3)=O(125000)
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())

LI = []
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
            LI.append(x)

counter = 0
for l in range(len((LI))):
    if LI[l] == x:
        counter += 1
    
print(counter)

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

LI = []
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            y = 500*i+100*j+50*k
            LI.append(y)

counter = 0
for l in range(len((LI))):
    if LI[l] == x:
        counter += 1
    
print(counter)
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 500*i + 100*j + 50*k == x:
                count += 1
print(int(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())
ans=0
for ai in range(a+1):
  for bi in range(b+1):
    for ci in range(c+1):
      y=500*ai+100*bi+50*ci
      if x == y:
        ans+=1
        print(ai,bi,ci)
      if y>x:
        break
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):
      y=500*ai+100*bi+50*ci
      if x == y:
        ans+=1
      if y>x:
        break
print(ans)
Buggy code:
A,B,C,X=map(int,input().split()) #500,100,50, total
#X=500*a+100*b+50*c

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



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

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

# check

if X % 100 == 50 and C == 0:
    print(0)
else:
    all_case = len(
        [
            1
            for a in range(A)
            for b in range(B)
            for c in range(C)
            if 500 * a + 100 * b + 50 * c == X
        ]
    )
    
    print(all_case)

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

# check
if X % 100 == 50 and C == 0:
    print(0)
else:
    all_case = len(
        [
            1
            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
        ]
    )

    print(all_case)
Buggy code:
a=int(input(""))
b=int(input(""))
c=int(input(""))
x=int(input(""))
def countcourse(r,t,y,u):
  cnt=0
  for h in range(r):
    for l in range(t):
      for y range(y):
        if 500*h+100*l+50*y==u:
          cnt+=1
  return cnt
print(countcourse(a,b,c,x))

Fixed code:
a=int(input(""))
b=int(input(""))
c=int(input(""))
x=int(input(""))
def countcourse(r,t,y,u):
    cnt=0
    n=0
    for h in range(r+1):
        for l in range(t+1):
            for o in range(y+1):
                if 500*h+100*l+50*o==u:
                    cnt+=1
    return cnt
print(countcourse(a,b,c,x))
Buggy code:
# -*- coding: utf-8 -*-
 
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(1, A + 1):
  for j in range(1, B + 1):
    for k in range(1, C + 1):
      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 = 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):
    if X - i * 500 - j * 100 % 50 == 0 and X - i * 500 - j * 100 <= 50 * C
        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):
    y = X - i * 500 - j * 100
    if y % 50 == 0 and 0 <= y <=50*C:
        cnt += 1
        
print(cnt)
Buggy code:
aa = input()
bb = input()
cc = input()
x = input()
count = 0

for a in range(aa):
  for b in range(bb):
    for c in range(cc):
      if 500*a + 100*b + 50*c == x:
        count+=1
print(count)


Fixed code:
aa = int(input()) + 1
bb = int(input()) + 1
cc = int(input()) + 1
x = int(input())
count = 0

for a in range(aa):
  for b in range(bb):
    for c in range(cc):
      if 500*a + 100*b + 50*c == x:
        count+=1
print(count)
Buggy code:
A_500 = int(input())
B_100 = int(input())
C_50 = int(input())
X = int(input())

count = 0

for i in range(0, A_500 + 1):
	for j in range(0, B_100 + 1):
		for k in range(0, C_50 + 1):
			print(str(i) + ',' + str(j) + ',' + str(k))
			if X == i * 500 + j * 100 + k * 50:
				count += 1

print(count)

Fixed code:
A_500 = int(input())
B_100 = int(input())
C_50 = int(input())
X = int(input())

count = 0

for i in range(0, A_500 + 1):
	for j in range(0, B_100 + 1):
		for k in range(0, C_50 + 1):
			if X == i * 500 + j * 100 + k * 50:
				count += 1

print(count)
Buggy code:
#coding:utf-8

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):
      p = a * 500 + b * 100 + c * 50
      if p == x:
        cnt += 1
      elif p > x:
        break
print(cnt)

Fixed code:
#coding:utf-8
 
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):
      p = i * 500 + j * 100 + k * 50
      if p > x:
        break
      if p == x:
        cnt += 1
print(cnt)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 0

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

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

for ai in range(a + 1):
  for bi in range(b + 1):
    for ci in range(c + 1):
      total = 500 * ai + 100 * bi + 50 * ci
      if x == total:
        res += 1
        
print(res)
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):
            sum = 500 * a + 100 * b + 50 * c
            if sum == 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):
            sum = 500 * a + 100 * b + 50 * c
            if sum == x:
                ans += 1

print(ans)
Buggy code:
import sys
a = int(input())
b = int(input())
c = int(input())
n = 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==n:
        count += 1
  print(count)

Fixed code:
import sys
a = int(input())
b = int(input())
c = int(input())
n = 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==n:
        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):
    fhy = i * 500
    for j in range(0, b):
        ohy = j * 100
        for k in range(0, c):
            fty = c * 50
            if fhy + ohy + fty == 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):
    fhy = i * 500
    for j in range(b+1):
        ohy = j * 100
        for k in range(c+1):
            fty = k * 50
            if fhy + ohy + fty == x:
                ans += 1

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

Fixed code:

ans = 0
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
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, B, C, x = map(int, [input() for i in range(4)])
ans = [ _ 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 ]
print(len(ans))

Fixed code:
a, b, c, x = map(int, [input() for i in range(4)])
ans = [ a 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 ]
print(len(ans))
Buggy code:
s = []
for i in range(4):
    s.append(int(input()))

count = 0
for a in range(s[0] + 1):
    for b in range(s[1] + 1):
        for c in range(s[2] + 1):
            if( a*500 + b*100 + c*50 == s[3] ):
                count = count + 1

print(ans)


Fixed code:
s = []
for i in range(4):
    s.append(int(input()))

count = 0
for a in range(s[0] + 1):
    for b in range(s[1] + 1):
        for c in range(s[2] + 1):
            if( a*500 + b*100 + c*50 == s[3] ):
                count = count + 1

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

c=0

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

print(c)

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

print(count)
Buggy code:
a, b, c, x = map(int, [input() for i in range(0, 4)])
count = 0

for a_i in range(0, a + 1):
    if a_i * 500 > x:
        break
    for b_i in range(0, b + 1):
        for c_i in range(0, c + 1):
            print(a_i, b_i, c_i)
            if a_i * 500 + b_i * 100 + c_i * 50 == x:
                count += 1

print(count)

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

for a_i in range(0, a + 1):
    if a_i * 500 > x:
        break
    for b_i in range(0, b + 1):
        for c_i in range(0, c + 1):
            if a_i * 500 + b_i * 100 + c_i * 50 == x:
                count += 1

print(count)
Buggy code:
def solve(a,b,c,x):
    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
    return count

A,B,C,X = map(int, input().split())
print(solve(A,B,C,X))   

Fixed code:
def solve(a,b,c,x):
    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
    return count

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

print(solve(A,B,C,X))
Buggy code:
A, B, C, X = [int(input()) for i in range(4)]
count = 0
for a in range(A):
    for b in range(B):
        for c in range(C):
            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 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:
# https://atcoder.jp/contests/abc087/tasks/abc087_b

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:
# https://atcoder.jp/contests/abc087/tasks/abc087_b

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)