Problem:


Score : 200 points

Problem Statement

You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?

Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Constraints

0 \leq A, B, C \leq 50

A + B + C \geq 1

50 \leq X \leq 20 000

A, B and C are integers.

X is a multiple of 50.

Input

Input is given from Standard Input in the following format:

A
B
C
X

Output

Print the number of ways to select coins.

Sample Input 1

2
2
2
100

Sample Output 1

2

There are two ways to satisfy the condition:

Select zero 500-yen coins, one 100-yen coin and zero 50-yen coins.

Select zero 500-yen coins, zero 100-yen coins and two 50-yen coins.

Sample Input 2

5
1
0
150

Sample Output 2

0

Note that the total must be exactly X yen.

Sample Input 3

30
40
50
6000

Sample Output 3

213



Sample input:
2
2
2
100


Sample output:
2

Submission status: Wrong Answer

Solution code:
def main():
    A = int(input())  # 500円の枚数
    B = int(input())  # 100円の枚数
    C = int(input())  # 50円の枚数
    X = int(input())
    result = 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:
                    result += 1

    print(result)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    A = int(input())  # 500円の枚数
    B = int(input())  # 100円の枚数
    C = int(input())  # 50円の枚数
    X = int(input())
    result = 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:
                    result += 1

    return result


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution 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*B + 50*C == X:
        res += 1

print(res)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = 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) == d:
                count += 1
print(count)

Submission status: Wrong Answer

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

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

        
print(counter)

Submission status: Wrong Answer

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

comb = 0

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

Submission status: Wrong Answer

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

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

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for a in range(A + 1):
  if 500 * a > X:
    break
  elif 500 * a == X:
    cnt += 1
    continue
  for b in range(B + 1):
    if 500 * a + 100 * b > X:
      break
    elif 500 * a + 100 * b == X:
      cnt += 1
      continue
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c > X:
        break
      elif 500 * a + 100 * b + 50 * c < X:
        continue
      elif 500 * a + 100 * b + 50 * c == X:
        cnt += 1
        continue
        
print(c)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
c = 0

for a in range(A + 1):
  if 500 * a > X:
    break
  elif 500 * a == X:
    c += 1
    continue
  for b in range(B + 1):
    if 500 * a + 100 * b > X:
      break
    elif 500 * a + 100 * b == X:
      c += 1
      continue
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c > X:
        break
      elif 500 * a + 100 * b + 50 * c < X:
        continue
      elif 500 * a + 100 * b + 50 * c == X:
        c += 1
        continue
        
print(c)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
c = 0

for a in range(A):
  if 500 * a > X:
    break
  elif 500 * a == X:
    c += 1
    continue
  for b in range(B):
    if 500 * a + 100 * b > X:
      break
    elif 500 * a + 100 * b == X:
      c += 1
      continue
    for c in range(C):
      if 500 * a + 100 * b + 50 * c > X:
        break
      elif 500 * a + 100 * b + 50 * c < X:
        continue
      elif 500 * a + 100 * b + 50 * c == X:
        c += 1
        continue
        
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


count=0

for a_num in range(a+1):
  for b_num in range(b+1):
    for c_num in range(c+1):
      if a*500+b*100+c*50==x:
        count+=1

print(str(count))

Submission status: Wrong Answer

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

counter = 0

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

Submission status: Wrong Answer

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

R = min(C, X // 50)
Q = min(B, (X - 50 * R) // 100)
P = min(A, (X - 50 * R - 100 * Q) // 500)

if 500 * P + 100 * Q + 50 * R == X:
	ans = 1
	
	while True:
		while True:
			if 50 * R >= 100 and Q < B:
				R -= 2
				Q += 1
				ans += 1
			else:
				break
		
		if 100 * Q + 50 * R >= 500 and P < A:
			P += 1
			R = min(C, (X - 500 * P) // 50)
			Q = min(B, (X - 500 * P - 50 * R) // 100)
			ans += 1
		else:
			break

else:
	ans = 0

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
X_div = X/50
count = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if(10*i + 2*j + k == X_div):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
X_div = X/50
count = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if(10*i + 5*j + k == X_div):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
X_div = X%50
count = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if(10*i + 5*j + k == X_div):
                count += 1
print(count)

Submission status: Wrong Answer

Solution 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):
      s = 500*i + 100*j + 50*j
      if s==x:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
    for x in range(b+1):
        for z in range(c+1):
            if 500 * i + 100 * x + 10 * z == x:
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution 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 500*a+100*b+50*c==X:
                cnt=cnt+1
print(cnt)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ret = 0
print(a,b,c,x)
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:
        ret += 1
print(ret)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ret = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if (i*500 + i*100 + k*50) == x:
        ret += 1
print(ret)

Submission status: Wrong Answer

Solution 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+b+c == x:
        ans = ans+1
        
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt=0
i=0
j=0
k=0
while i <= A:
  while j <= B:
    while k <= C:
      sum=500*i+100*j+50*k
      print(sum)
      if sum== X:
        cnt+=1
      k+=1
    j+=1
    k=0
  i+=1
  j=0
  k=0
print(cnt)

Submission status: Wrong Answer

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

counter = 0
for i in range(0, A+1):
    ans = X - 500 * i
    if ans > 0:
        for n in range(0, B+1):
            ans = ans - 100 * n
            if ans > 0 and (ans / 50) <= C:
                counter += 1
            elif ans == 0:
                counter += 1
    elif ans == 0:
        
        counter += 1
        
# 全探索
'''
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)

Submission status: Wrong Answer

Solution 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 * i + 100 * n + 50 * t
            if total == X:
                counter += 1
print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

counter = 0
for i in range(0, A):
    ans = X - 500 * i
    if ans > 0:
        for n in range(0, B):
            ans = ans - 100 * n
            if ans > 0 and (ans / 50) <= C:
                counter += 1
            elif ans == 0:
                counter += 1
    elif ans == 0:
        counter += 1

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import heapq

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
import re  # 正規表現, findall('正規表現', 文字列), search('正規表現', 文字列)
import sys # プログラム終了：sys.exit()
# sys.setrecursionlimit(10**6) # 再帰呼び出しの上限を上げる

def i_input(): return int(input())
def s_input(): return map(int,input().split())
def l_input(): return list(map(int, input().split()))
# 文字列のまま受け取りたいときはinput()

def check(x, a, b, c):
    diff = x - 500 * a - 100 * b
    if diff >= 0 and diff % 50 == 0 and diff // 50 <= c:
        print(a,b,diff // 50)
        return True
    else:
        return False

def main():
    a = i_input() # 500
    b = i_input() # 100
    c = i_input() # 50
    x = i_input() # sum

    count = 0
    for i in range(a + 1):
        for j in range(b + 1):
            if check(x, i, j, c):
                count += 1

    print(count)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a = int(input()) #500円
b = int(input()) #100円
c = int(input()) #50円
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)

Submission status: Wrong Answer

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100 * j
        for k in range(min(c,Remains//50)+1):
            if k == 0:
                count = count + 1
            else: continue

print(count)

Submission status: Wrong Answer

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100*j
        for k in range(min(c,Remains//50)+1):
            count = count + 1

print(count)

Submission status: Wrong Answer

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        count = count + 1

print(count)

Submission status: Wrong Answer

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100 * j
        for k in range(min(c,Remains//50)+1):
            count = count + 1

print(count)

Submission status: Wrong Answer

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

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x/50
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        remainss = remains - 100 * j
        for k in range(min(c,remainss//50)):
            count = count + 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#define
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0

#sorting
for e in range(0,a+1):
    if e*500 >= x:
        y=x-e*500
        for f in range(0,b+1):
            if f*100 >= y:
                z=y-100*f
                for g in range(0,c+1):
                    if g*50 == z :                                            
                        count = count +1
                        
                       
print(count)

Submission status: Wrong Answer

Solution code:
#define
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0

#sorting
for e in range(0,a+1):
    if e*500 >= x:
        y=x-e*500
        for f in range(0,b+1):
            if f*100 >= y:
                z=x-100*f
                for g in range(0,c+1):
                    if g*50 == z :                                            
                        count = count +1
                        
                       
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
x=int(x/50)
countlist=[]

for e in range(0,a):
    if x < e*10:
        break
    else:
        x -= e*10
        count=0
        for f in range(0,b):
            if x < f*2 :
                break
            else:
                if x-f*2 <= c :
                    count = count +1
            countlist.append(count)

print(countlist)

Submission status: Wrong Answer

Solution 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 + c * 50 == x:
                ans += 1

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
coin500 = int(input())
coin100 = int(input())
coin050 = int(input())
target = int(input())
x = 0

for a in range(coin500):
  for b in range(coin100):
    for c in range (coin050):
     if target == a * 500 + b * 100 + c * 50:x += 1
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
## ABC087B - Coins
import sys
input = sys.stdin.readline

a, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))
count = 0

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

Submission status: Wrong Answer

Solution 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):
    d = x - 500 * i - 100 * j
    if 0 <= d <= c * 50:
      ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,x=[int(input()) for i in range(4)]
cnt=0
for i in range(a):
	if 500*i>x:break
	for j in range(b):
		if 500*i+100*j>x:break
		if (x-500*i-100*j)<=50*c:cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution 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):
            total = 500 * a + 100 * b + 50 * c
            if total == x:
                count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C  =int(input())
X = int(input())
count = 0

for i in range(A + 1):
    total = i * 500
    print("i",i, total)
    if total == X:
        count += 1
        continue
    if total > X:
        break

    for j in range(B + 1):
        total = i * 500
        total += j * 100
        print("j" ,i , j,total)

        if total == X:
            count += 1

        if total > X:
            break

        for k in range(1,C + 1):
            total += 50
            print("k",i,j,k , total)
            if total == X:
                count += 1


            if total > X:
                break
print(count)

Submission status: Wrong Answer

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

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

print(output)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input()) # 500
B = int(input()) # 100
C = int(input()) # 50
X = int(input()) # target

ans = 0

for i in range(A+1):
  amount = 500* (i - 1)
  for j in range(B+1):
    amount += 100*(j - 1)
    for h in range(C+1):
      amount += 50*(h - 1)
      if amount == X:
        ans += 1
        
        
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500):
  for j in range(b100):
    for k in range(c50):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500):
  for j in range(b100):
    for k in range(c50):
      goukei = i * 500 + j * 100 + k * 50
      if goukei > X:
        is_over = True 
        break
      elif goukei == X:
        ans += 1
    if is_over:
      break
  if is_over:
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#枚数の入力
input500=int(input())
input100=int(input())
input50=int(input())
inputSum=int(input())

#通りの変数
sumWay=0
tempSum=0

if inputSum >= 500 and input500 > 0:
    #500円の計算
    for i in range(input500 + 1):
        tempSum=0
        tempSum+=(500 * i)
        
        #ここで全体を抜ける処理
        if inputSum == tempSum:
            sumWay+=1
            break
        
        elif tempSum < inputSum :
            #100円の計算
            for m in range(input100 + 1):
                tempSum100=tempSum
                tempSum100=tempSum + (100 * m)
                if inputSum < tempSum100:
                    break
                elif tempSum100 == inputSum:
                    sumWay+=1
                    continue
                else:
                    #50円の計算
                    for n in range(input50 + 1):
                        tempSum50=tempSum100
                        tempSum50= tempSum100 + (50 * n)
                        #ピッタリ
                        if inputSum == tempSum50:
                            sumWay+=1
                            continue
                        elif inputSum < tempSum50:
                            break
elif inputSum < 500 and input100 >0 :
#100円の計算
    for m in range(input100 + 1):
        tempSum100=tempSum
        tempSum100=tempSum + (100 * m)
        if inputSum < tempSum100:
            break
        elif tempSum100 == inputSum:
            sumWay+=1
            continue
        else:
            #50円の計算
            for n in range(input50 + 1):
                tempSum50=tempSum100
                tempSum50= tempSum100 + (50 * n)
                #ピッタリ
                if inputSum == tempSum50:
                    sumWay+=1
                    continue
                elif inputSum < tempSum50:
                    break
elif inputSum < 100 and inputSum > 50 and input50 >0:
    sumWay=1

print(sumWay)

Submission status: Wrong Answer

Solution 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

Submission status: Wrong Answer

Solution code:

def coins():
    fivehund = int(input())
    onehund = int(input())
    fifty = int(input())
    target = int(input())
    result_count = 0

    for count500 in range(0,fivehund):
        for count100 in range(0,onehund):
            for count50 in range(0,fifty):
                 current = 500*count500 + 100*count100 + 50*count50
                 if target == current:
                     result_count += 1
    
    print(result_count)

if __name__ == '__main__':
    coins()

Submission status: Wrong Answer

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

total,out=0,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 == 0:
        out+=1
        
print(out)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
n=int(input())
ans=0
for i in range(a):
  for j in range(b):
    if 500*i+100*j>n:
      break
    else:
      if(n-500*i-100*j)%50==0 and (n-500*i-100*j)//50<=c:
        ans+=1
  if 500*i>n:
    break
print(ans)

Submission status: Wrong Answer

Solution code:
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a):
    for ii in range(b):
      for iii in range(c):
        if x==500*i+100*ii+50*iii:
          ans+=1
  return ans
a=int(input())
b=int(input())
c=int(input())
x=int(input())
print(tyoudo(a,b,c,x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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(100*a + 10*b + c == x):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
end=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            s= i*500 + j*100 + k*50
            if s==x:
                end+=1
print(c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
X = int(input())

_500 = 500
_100 = 100
_50 = 50
count = 0

for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if A == 0 or B == 0 or C == 0:
                continue
                    
            if X - (a*_500 + b*_100 + c*_50) == 0:
                count = count + 1
print(count)