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:
import numpy as np
# 複数個格納
# A B = map(int, input().split())
# 行列化
# A = np.array(A)
# A=A.reshape(1,-1)
# A=A.T
#行列の比較
#C=((A%2 == vector0).all())


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

gohyaku=(np.arange(0,500*A+1,500)).reshape(1,-1)
hyaku=(np.arange(0,100*B+1,100)).reshape(1,-1)
goju=(np.arange(0,50*C+1,50)).reshape(1,-1)


gohyaku1=X-(gohyaku+hyaku.T)
count=0

print(gohyaku1)
for i in range(A):
    for k in range(B):
        if 0 <= gohyaku1[k,i]/50 <= C:
            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):
    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:
a,b,c,x =[int(input(i)) 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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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 = A*i + B*j + C*k
            if sum==X:
                out+=1
print(out)

Submission status: Wrong Answer

Solution 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 = A*i + B*j + C*k
            if sum==X:
                out+=1
print(out)

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

coin_500 = int(input('500'))
coin_100 = int(input('100'))
coin_50 = int(input('50'))

target = int(input('target'))

counter = 0


for i_500 in range(coin_500 + 1):
    # print('======= loop 500 =======')
    if i_500 * 500 > target:
        break

    for i_100 in range(coin_100 + 1):
        # print('-------- loop 100 ---------')
        if i_500 * 500 + i_100 * 100 > target:
            break

        for i_50 in range(coin_50 + 1):
            # print('........... loop 50 ..........')
            if i_500 * 500 + i_100 * 100 + i_50 * 50 == target:
                # print('match: ', i_500, i_100, i_50)
                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 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:
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*c == 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 A_coin in range(a):
    for B_coin in range(b):
        for C_coin in range(c):
            if(A_coin * 500 + B_coin * 100 + C_coin * 50 == X):
                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 a*500+b*100+c*50==x:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

ans = 0
for ai in range(A):
  for bi in range(B):
    for ci in range(C):
      if 10*ai + 2*bi + ci == X:
        ans += 1
        
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = []
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            l.append([i, j, k])
count = 0
for i in range(len(l)):
    sum = l[i][0] * 50 + l[i][1] * 100 + l[i][2] * 500
    if sum == x:
        count += 1
print(count)

Submission status: Wrong Answer

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

result = 0

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

print(result)

Submission status: Wrong Answer

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

result = 0

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

print(result)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
m=int(input())//50
ans=0
for x in range(1+m//10):
  n=m-10*x
  for y in range(1+n//2):
    z=n-2*y
    if y<=b and z<=c:
      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 j in range(b+1):
    k=x-i*500+j*100
    if k>=0 and k%50 ==0 and k//50<=c:
      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):
  for j in range(b):
    k=x-i*500+j*100
    if k>=0 and k%50 ==0:
      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):
            if i * 500 + j * 100 + k * 50 == X:
                cnt += 1
print(cnt)

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

Submission status: Wrong Answer

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

if X > 500*A + 100*B + 50*C:
    print(0)
else:
  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:
                total = total + 1
print(total)

Submission status: Wrong Answer

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

count=0
a_max=min(x//500,a) #500玉の最大数
for i in range(a_max+1):#ループ数は+1　(0~max枚)
  # print("i:500円玉",i)
  b_max=min((x-500*i)//100,b) #全体から500円玉の値段を引いた、残りの100玉の枚数を考える
  print("100円玉最大数",b_max)
  for j in range(b_max+1):
    # print("i,j",i,j)
    if (x-500*i-100*j)//50<=c:
      count+=1

print(count)

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 a*i + b*j + c*k == x:
        res += 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n500 = int(input())
n100 = int(input())
n50 = int(input())
p = int(input())
ans = 0

for i in range(n500):
    temp = 0
    temp = i*500
    for j in range(n100):
        temp = i*500+j*100
        for k in range(n50):
            temp = i*500+j*100+k*50 
            if temp == p:
                ans+=1

print(ans)

Submission status: Wrong Answer

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

i=0
j=0
ans=0
while i <=A:
    X_aftera=X-500*i
    if X_aftera<0:
        break
    while j<=B:
        X_afterb=X_aftera-100*j
        if X_afterb<0:
            break
        if X_afterb//50<=C:
            ans +=1
        j+=1
    i+=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 + 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):
    for j in range(b+1):
        if x <= i*500 + j*100 + c*50:
            count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
_x = int(input())
answer = 0
for c in range(c50+1):
    for b in range( b100+1):
        for a in range(a500+1):
            print (a,b,c)
            if a*500 + b*100 + c*50 == _x:
                answer += 1
print (answer)

Submission status: Wrong Answer

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
_x = int(input())
c = 0
for a in range(a500+1):
    for b in range(b100+1):
        for c in range(c50+1):
            if a*500 + b*100 + c*50 == _x:
                c += 1
print (c)

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

print(count)

Submission status: Wrong Answer

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

for i in range(a):
    for j in range(b):
        for l in range(c):
            sum = a*500 + b*100 + c*50
            if sum == 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 coin_500 in range(0, A):
  for coin_100 in range(0, B):
    for coin_50 in range(0, C):
      if coin_500 + coin_100 + coin_50 == X:
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
count = 0
A = int(input())
B = int(input())
C = int(input())
X = int(input())
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)

Submission status: Wrong Answer

Solution code:
big = int(input())
mid = int(input())
small = int(input())
input_money = int(input())

cnt = 0
for i in range(big+1):
    for j in range(mid+1):
        for k in range(small+1):
            if (input_money-500*i)>=0:
                money = (input_money-500*i)
                if money==0:
                    cnt += 1
                    break
                if (money-100*j)>=0:
                    money = (money-100*i)
                    if money==0:
                        cnt += 1
                        break
                    if (money-50*j)>=0:
                        money = (money-50*i)
                        if money==0:
                            cnt += 1
            else:
                continue
            break
        else:  
            continue
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
big = int(input())
mid = int(input())
small = int(input())
input_money = int(input())

cnt = 0
for i in range(big+1):
    for j in range(mid+1):
        for k in range(small+1):
            if (input_money-500*i)>=0:
                money = (input_money-500*i)
                if money==0:
                    cnt += 1
                    break
                if (money-100*j)>=0:
                    money = (money-100*i)
                    if money==0:
                        cnt += 1
                        break
                    if (money-50*j)>=0:
                        money = (money-50*i)
                        if money==0:
                            cnt += 1
                            break
            elif (input_money-100*j)>=0:
                money = (input_money-100*i)
                if money==0:
                    cnt += 1
                    break
                if (money-50*j)>=0:
                    money = (money-50*i)
                    if money==0:
                        cnt += 1
                        break
            elif (input_money-50*j)>=0:
                money = (input_money-50*i)
                if money==0:
                    cnt += 1
                    break
            else:
                continue
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
big = int(input())
mid = int(input())
small = int(input())
input_money = int(input())

cnt = 0
for i in range(big+1):
    for j in range(mid+1):
        for k in range(small+1):
            if (input_money-500*i)>=0:
                money = (input_money-500*i)
                if money==0:
                    cnt += 1
                    break
                if (money-100*j)>=0:
                    money = (money-100*i)
                    if money==0:
                        cnt += 1
                        break
                    if (money-50*j)>=0:
                        money = (money-50*i)
                        if money==0:
                            cnt += 1
                            break
            elif (money-100*j)>=0:
                money = (money-100*i)
                if money==0:
                    cnt += 1
                    break
                if (money-50*j)>=0:
                    money = (money-50*i)
                    if money==0:
                        cnt += 1
                        break
            elif (money-50*j)>=0:
                money = (money-50*i)
                if money==0:
                    cnt += 1
                    break
            else:
                continue
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
big = int(input())
mid = int(input())
small = int(input())
input_money = int(input())

cnt = 0
for i in range(big+1):
    for j in range(mid+1):
        for k in range(small+1):
            if (input_money-500*i)>=0:
                money = (input_money-500*i)
                if money==0:
                    cnt += 1
                    break
                if (money-100*j)>=0:
                    money = (money-100*i)
                    if money==0:
                        cnt += 1
                        break
                    if (money-50*j)>=0:
                        money = (money-50*i)
                        if money==0:
                            cnt += 1
                            break
            else:
                continue
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
def i():
  return int(input())
A = i()
B = i()
C = i()
X = i()
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:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C, X = [int(input()) for i in range(4)]
print(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))

Submission status: Wrong Answer

Solution code:
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
from fractions import gcd
def resolve():
    A=[int(input())for i in range(4)]
    cnt=0
    for i in range(A[0]):
        for j in range(A[1]):
            for k in range(A[2]):
                if 500*i+100*j+50*k==A[-1]:
                    cnt+=1
    print(cnt)
            
        
#%%submit!    
resolve()

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

Submission status: Wrong Answer

Solution code:
A, B, C, X = [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:
num_500 = int(input())
num_100 = int(input())
num_050 = int(input())
total = int(input())

count = 0
for count_500 in range(0, num_500 + 1):
    sum_500 = count_500 * 500
    for count_100 in range(0, num_100 + 1):
        sum_100 = count_100 * 100
        for count_050 in range(0, num_050 + 1):
            sum_050 = count_050 * 50
            if total == (sum_500 + sum_100 + sum_050):
                count += 1

print(count if count != 0 else "a")

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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 A*i + B*j + C*k == X:
        cnt +=1

print(cnt)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print((a + 1) * (b + 1) * (c + 1))

Submission status: Wrong Answer

Solution code:
from itertools import product
import numpy as np
a = int(input())
b = int(input())
c = int(input())
x = int(input())

a = ', ' + ', '.join([str(sum(el)) for el in 
               product(
                   np.arange(a+1)*500, np.arange(b+1)*100, np.arange(c+1)*50
               )
                     
                      if not sum(el)==0 
               ]) + ', '
print(a.count(
    ', {},'.format(x)
))

Submission status: Wrong Answer

Solution code:
from itertools import product
import numpy as np
a = int(input())
b = int(input())
c = int(input())
x = int(input())

a = ', '.join([str(sum(el)) for el in 
               product(
                   np.arange(a+1)*500, np.arange(b+1)*100, np.arange(c+1)*50
               )]) + ', '
print(a.count(
    ', {},'.format(x)
))

Submission status: Wrong Answer

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

count = 0


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

Submission status: Wrong Answer

Solution code:
A,B,C,x=[int(input()) for _ in range(4)]
a=x//500
b=x//100
c=x//50
ans=0
for s in range(1,a+1):
  for t in range(1,b+1):
    u=(x-500*s-100*t)//50
    if all([0<=s<=A,0<=t<=B,0<=u<=C]):
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C,x=[int(input()) for _ in range(4)]
a=x//500
b=x//100
c=x//50
ans=0
for s in range(1,a+1):
  for t in range(1+b+1):
    u=(x-500*s-100*t)//50
    if all([0<=s<=A,0<=t<=B,0<=u<=C]):
      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):
  for j in range(b):
    for k in range(c):
      if x == 500*(i+1)+100*(j+1)+50*(k+1) :
        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):
  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:
a, b, c, x = map(int, [input() for i in range(4)])
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)

Submission status: Wrong Answer

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

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 500*i + 100*j + 50*k == X:
        count += 1

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

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

print(sum(i * 500 + j * 100 + k * 50 for i in range(A + 1) for k in range(B + 1) for j in range(C + 1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

rCnt = 0
ttla = 0
ttlb = 0

ia = 0
ib = 0
ic = 0

while ia <= a:
  ttla = 500 * ia
  ia = ia + 1
  while ib <= b:
    ttlb = 100 * ib
    ib = ib + 1
    while ic <= c:
      if ttla + ttlb + 50 * ic:
        rCnt = rCnt + 1
      ic = ic + 1

print(rCnt)

Submission status: Wrong Answer

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

rCnt = 0
ttla = 0
ttlb = 0

for ia in range(a):
  ttla = 500 * ia
  for ib in range(b):
    ttlb = 100 * ib
    for ic in range(c):
      if ttla + ttlb + 50 * ic:
        rCnt = rCnt + 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B,C,X = [int() for i in range(4)]
sum(100*a + 50*b + 10*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1))
print(sum)

Submission status: Wrong Answer

Solution code:
A,B,C,X = [int() for i in range(4)]
sum(100*a + 50*b + 10*c for a in range(A+1) for b in range(B+1) for c in range(C+1))
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = 30
B = 40
C = 50
X = 6000

A_list = [500*i for i in range(A+1)]
B_list = [100*i for i in range(B+1)]
C_list = [50*i for i in range(C+1)]
sum_list = []

for i in A_list:
    for j in B_list:
        i_j = i + j
        for k in C_list:
            sum_list.append(i_j + k)

result = 0
for i in sum_list:
    if i == X:
        result += 1

print(result)

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

print(count)

Submission status: Wrong Answer

Solution code:
x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0


def judge(i, j, k, xxx):
    sum = 500 * i + 100 * j + 50 * k
    return sum == xxx and sum <= 20000 and sum >= 50


count = 0
for i in range(x500 + 1):
    if judge(i, j, k, xxx):
        count += 1
    for j in range(x100 + 1):
        if judge(i, j, k, xxx):
            count += 1
        for k in range(x50 + 1):
            if judge(i, j, k, xxx):
                count += 1
print(count)