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: Accepted

Solution code:
yen500,yen100,yen50,fee =  [int(input()) for i in range(4)]

counter=0
for a in range(yen500+1):
    for b in range(yen100+1):
        for c in range(yen50+1):
            total = 500 * a + 100 * b + 50 * c
            if total == fee:
                counter +=1
                break
print(counter)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    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)

resolve()

Submission status: Accepted

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

Submission status: Accepted

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):
        C = int((x - 500 * i - 100 * j) / 50)
        if C >= 0 and C <= c:
            cnt += 1
            
print(cnt)

Submission status: Accepted

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

setc = set()
for i in range(c+1):
    setc.add(50*i)

ans = 0
for i in range(a+1):
    for j in range(b+1):
        if x - 500*i - 100*j in setc:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
a, b, c, x = map(int, [input() for _ in range(4)])
ans = 0
# コインの枚数なので、offsetとして+1
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: Accepted

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

Submission status: Accepted

Solution code:
A,B,C,X = [int(input()) for i in range(4)]#500,100, 50, 合計

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


# スペース区切りの整数の入力
# 出力
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

ans=0
for i in range(a+1):
    for g in range(b+1):
        for l in range(c+1):
            if 500*i+100*g+50*l==x:
                ans+=1
print(ans)

Submission status: Accepted

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

ans = [(a_i, b_i, c_i) for a_i in range(a+1) for b_i in range(b+1) for c_i in range(c+1) \
      if a_i*500+b_i*100+c_i*50==x]
print(len(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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):
            sum = 500 * a + 100 * b + 50 * c
            # print(sum)
            if(sum == X):
                count += 1

print(count)

Submission status: Accepted

Solution code:
a, b, c, x = [int(input()) for _ 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 * i + 100 * j + 50 * k == x:
                count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=[int(input()) for _ in range(3)]
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)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

    res = 0
    mA = min(X//500, A)
    for i in range(mA+1):
        Y = X - 500 * i
        mB = min(Y//100, B)
        for j in range(mB+1):
            Z = Y - 100 * j
            if Z <= 50*C:
                res += 1

    print(res)
    
resolve()

Submission status: Accepted

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

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

    print(res)
    
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
l = []

for i in range(4):
    l.append(int(input()))

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    #N = map(int, open(0).read().split())
    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):
                #print(i,j,k,sep=' - ',end=' ')
                #print(i*500 + j*100 + k*50)
                if x == i*500 + j*100 + k*50:
                    cnt += 1
    print(cnt)
main()

Submission status: Accepted

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

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

print(y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def coins(a,b,c,x):
    num=0
    for i in range(a+1):
        for w in range(b+1):
            for q in range(c+1):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a=int(input())
  b=int(input())
  c=int(input())
  x=int(input())
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

def Coins(a , b , c , x):

    count = 0

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

    return count

def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    print(Coins(a , b , c , x))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
coin=[]
ans=0
for i in range(3):
    coin+=map(int,input().split())
X=int(input())
for a in range(coin[0]+1):
    for b in range(coin[1]+1):
        for c in range(coin[2]+1):
            total=a*500+b*100+c*50
            if total==X:
                ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

A = int(input())
B = int(input())
C = int(input())
X = int(input())
price = 0
ans = 0 

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

print(ans)

Submission status: Accepted

Solution code:
s=[[int(j) for j in input().split()] for i in range(4)]
a=s[0]
b=s[1]
c=s[2]
x=s[3]
a=a[0]
b=b[0]
c=c[0]
x=x[0]
count=0
ans=list()
for n in range(a+1):
    for m in range(b+1):
        for l in range(c+1):
            add=n*500+m*100+50*l
            if add==x:
                count+=1
                ans.append([n,m,l])
print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ctn =0
for aa in range(a+1):
    for bb in range(b+1):
        for cc in range(c+1):
            if x == aa*500+bb*100+cc*50:
                ctn += 1
print(ctn)

Submission status: Accepted

Solution code:
import numpy as np

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

ax_a = np.linspace(0, 500*a, a+1)
ax_b = np.linspace(0, 100*b, b+1)
ax_c = np.linspace(0, 50*c, c+1)

aa, bb, cc = np.meshgrid(ax_a, ax_b, ax_c)
grid = aa+bb+cc
ans = (grid==x).sum()
print(ans)

Submission status: Accepted

Solution code:
#ABC087

l = [int(input()) for _ in range(4)]


count = 0
for i in range(l[0]+1):
    s = l[3]
    if s - i * 500 >= 0:
        
        for j in range(l[1]+1):
            s = l[3] - i * 500
            if s - j * 100 >= 0:
                
                s -= j * 100
                #print(s)
                if s // 50 <= l[2]:
                    #print(i,j,s//50)
                    count += 1
                
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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+k*50 == x:
        ans += 1
print(ans)

Submission status: Accepted

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) + (k*50) == x:
                ans += 1
print(ans)

Submission status: Accepted

Solution 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 ((i_a * 500) + (i_b * 100) + (i_c * 50)) == x:
                count += 1
print(count)

Submission status: Accepted

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*k:
                ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
## coding: UTF-8
A = int(input()) # 500
B = int(input()) # 100
C = int(input()) # 50
X = int(input()) 

#max = 500 * A + 100 * B + 50 * C #払える最大値
#print(max)

counter = 0 #場合の数カウンター（これが回答になる）
xa = A
xb = B
xc = C

def purchase(a,b,c):
    return 500 * a + 100 * b + 50 * c

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            #print(purchase(i,j,k))
            if(purchase(i,j,k) == X):
                counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 i*500 + j*100 + k*50 == X:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
#087_B
a,b,c,x=[int(input()) for i in range(4)]
print(sum([500*p+100*q+50*r==x for p in range(a+1) for q in range(b+1) for r in range(c+1)]))

Submission status: Accepted

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
print(int(count))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
max_500 = int(X/500)
cnt_500 = min(max_500,A)+1
#print(cnt_500)
for i in range(cnt_500):
    X_500=X-i*500
    max_100=int(X_500/100)
    cnt_100=min(max_100,B)+1
    #print(cnt_100)
    for j in range(cnt_100):
        X_100=X_500-j*100
        if X_100%50==0 and int(X_100/50)<=C:
            cnt+=1
print(cnt)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
abcx=[int(input()) for _ in range(4)]
count=0
for i in range(abcx[0]+1):
  for j in range(abcx[1]+1):
    if abcx[3]-(500*i+100*j)>=0 and (abcx[3]-(500*i+100*j))%50==0 and (abcx[3]-(500*i+100*j))//50<=abcx[2]:
      count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = [int(input()) for i in range(4)]
A=i[0]
B=i[1]
C=i[2]
X=i[3]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_same(i, j, k, x):
    total = i*500 + j*100 + k*50
    return total==x

coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
x = int(input())
ans = 0
for i in range(coin_500+1):
    for j in range(coin_100+1):
        for k in range(coin_50+1):
            if is_same(i, j, k, x):
                ans = ans + 1
print(ans)

Submission status: Accepted

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 + k * 50 == x:
        ans += 1
print(ans)

Submission status: Accepted

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

A = 500
B = 100
C = 50
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            amount = i*A + j*B + k*C
            if amount == x:
                count += 1


print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

ans = 0
for a1 in range(0,a+1):
    for b1 in range(0,b+1):
        for c1 in range(0,c+1):
            yen = a1*500 + b1*100 + c1*50
            if yen == x:
                ans += 1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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(500*i+100*j+50*k)
n=0
for i in range(len(l)):
    if l[i]==x:
        n+=1
print(n)

Submission status: Accepted

Solution code:
import itertools

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)

Submission status: Accepted

Solution code:
v500 = int(input())
v100 = int(input())
v50 = int(input())
s = int(input())
c = 0
for i in range(v500, -1, -1):
    if 500 * i < s:
        for j in range(v100, -1, -1):
            if 500 * i + 100 * j < s:
                for k in range(v50, -1, -1):
                    if 500 * i + 100 * j + 50 * k == s:
                        c += 1
            elif 500 * i + 100 * j == s:
                c += 1
    elif 500 * i == s:
        c += 1
print(c)

Submission status: Accepted

Solution code:
A,B,C,X = map(int,open(0))
ans=0
for i in range(0,A+1):
  for j in range(0,B+1):
    tmp = (X - 500*i - 100*j)/50
    if tmp.is_integer() and tmp >=0 and tmp <=C:
      ans +=1
print(ans)

Submission status: Accepted

Solution code:
N_500 = int(input())
N_100 = int(input())
N_50 = int(input())
X = int(input())

cnt = 0

for i_500 in range(N_500 + 1):
    
    for j_100 in range(N_100 + 1):
        
        for k_50 in range(N_50 + 1):
            
            summ = 500 * i_500 + 100 * j_100 + 50 * k_50
            if (summ == X):
                cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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 f in range(C+1):
      if i*500 + j*100 + f*50 == X:
        count +=1
            
print(count)

Submission status: Accepted

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

cnt = 0
price = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution 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):
            if ai * 500 + bi * 100 + ci * 50 == x:
                ans += 1

print(ans)

Submission status: Accepted

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

ans = 0
for i in range(0, 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: Accepted

Solution code:
five_hund = int(input())
one_hund = int(input())
fifty = int(input())
X = int(input())
count = 0

for five in range(five_hund + 1):
  for one in range(one_hund + 1):
    for fif in range(fifty + 1):
      if(five * 500 + one * 100 + fif * 50 == X):
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
#     num = [int(input()) for i in range(4)]
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    counter = 0
#     if (10*A+2*B+C < X):
#         print(counter)
#         return
#     if (X%2==1 && C == 0):
#         print(counter)
#         return
    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):
                    counter += 1
    print(counter)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print([500*a+100*b+50*c for c in range(C+1) for b in range(B+1) for a in range(A+1)].count(X))