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

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

print(r)

Submission status: Accepted

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
cnt = 0
for a in range(0,A+1):
    Y = X - 500*a
    if Y==0:
        cnt += 1
        break
    elif Y<0:
        break
    for b in range(0,B+1):
        Z = Y - 100*b
        if Z==0:
            cnt += 1
            break
        elif Z<0:
            break
        for c in range(0,C+1):
            W = Z - 50*c
            if W == 0:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
cnt = 0
for a in range(0,A+1):
    Y = X - 500*a
    if Y==0:
        cnt += 1
        continue
    elif Y<0:
        continue
    for b in range(0,B+1):
        Z = Y - 100*b
        if Z==0:
            cnt += 1
            continue
        elif Z<0:
            continue
        for c in range(0,C+1):
            W = Z - 50*c
            if W == 0:
                cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(l.count(x))

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())
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())
sumlist=[]

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            sumlist.append(i*500+j*100+k*50)
            # print(sumlist)
            
print(sumlist.count(X))

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 a*500 + b*100 + c*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(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=map(int,[input() for i in range(4)])

ans=0
for p in range(a+1): 
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x:
                ans=ans+1
print(ans)

Submission status: Accepted

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

def exist_combination(A,B,C,target):
  count = 0
  for ai in range(A+1):
    for bi in range(B+1):
      for ci in range(C+1):
        s = ai*500 + bi*100 + ci*50
        if s == target:
          count += 1                  
  return count

print(exist_combination(A,B,C,X))

Submission status: Accepted

Solution code:
value=[input().rstrip() for i in range(4)]
value=list(map(int,value))
#print(value)
a=value[3]
answer=0
for i in range(0,value[0]+1):
    fake=a-500*i
    if fake==0:
        answer+=1
        break
    else:
        for j in range(0,value[1]+1):
            if j>0:
                fake=fake-100
            if fake==0:
                answer+=1
                #print(str(j)+'!')
            elif fake>0 and fake<=50*value[2]:
                answer+=1
# print(str(answer)+'!')

#if a<=50*value[2]:
#    answer+=1
print(answer)

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

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

print(count)

Submission status: Accepted

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

ans = set()
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.add((a,b,c))
print(len(ans))

Submission status: Accepted

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

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

print(cont)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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 i*500+j*100+k*50==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 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:
                cnt += 1
print(cnt)

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):
			if 500 * a + 100 * b + 50 * c == 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 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(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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

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

print(r)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A + 1):
    x = 500 * i
    if x == X:
        ans += 1
        break
    elif x > X:
        break
    for j in range(B + 1):
        x = 500 * i + 100 * j
        if x == X:
            ans += 1
            break
        elif x > X:
            break
        for k in range(C + 1):
            x = 500 * i + 100 * j + 50 * k
            if x == X:
                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):
        if (X-(i*500 + j*100)) / 50 <= C and X-(i*500 + j*100) >= 0:
            cnt+=1

print(cnt)

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

Submission status: Accepted

Solution code:
import functools

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

if min(A, B, C, X) == X:
	print(0)

@functools.lru_cache(1000)
def num_patterns(A, B, C, X):
    if X == 0:
      	return 1

    if min(A, B, C, X) == X:
        return 0

    if A > 0:
        return sum(
            num_patterns(0, B, C, X - 500 * nA) if X >= 500 * nA else 0
            for nA in range(0, A + 1)
        )
    if B > 0:
        return sum(
            num_patterns(0, 0, C, X - 100 * nB) if X >= 100 * nB else 0
            for nB in range(0, B + 1)
        )
    if C > 0 and X % 50 == 0 and X / 50 <= C:
        return 1
    else:
        return 0

print(num_patterns(A, B, C, X))

Submission status: Accepted

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

count=0
for a1 in range(a+1):
  for b1 in range(b+1):
    for c1 in range(c+1):
      if x==500*a1+100*b1+50*c1:
        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:
# -coding: utf-8 -

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

s = a + b + c
#ans = []
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            money = 500*i+100*j+50*k
#            print(money)
            if money == x:
                count += 1
#                strs = str(i)+str(j)+str(k)
#                ans.append(strs)
      
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# a, b, c, x = map(int, input().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):
      if (500*i + 100*j + 50*k) == x:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#N = int(input())
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())
count = 0
for i in range(A+1):
  for s in range(B+1):
    for o in range(C+1):
      if X == 500*i + 100*s + 50*o:
        count+=1
print(count)

Submission status: Accepted

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

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

print(N)

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

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(i)*500 for i in range(0,int(input())+1)]
B=[int(i)*100 for i in range(0,int(input())+1)]
C=[int(i)*50 for i in range(0,int(input())+1)]
X=int(input())  
l=[]
for a in A:
  for b in B:
    for c in C:
      l.append(a+b+c)
print(l.count(X))

Submission status: Accepted

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

print(tmp)

Submission status: Accepted

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

ans = 0
flag = 0

for i in range(a+1):
    tmp = x - i * 500
    if tmp < 0:
        break
    for j in range(b+1):
        tmp = x - i * 500
        tmp -= j * 100
        if tmp < 0:
            break
        elif tmp//50 <= c and tmp%50 == 0:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c,x = map(int,[input() for i in range(4)])
cnt=0
for aa in range(a+1):
    for bb in range(b+1):
        for cc in range(c+1):
            if aa*500+bb*100+cc*50 == x:cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
a,b,c,x = list(map(int,[input() for i in range(4)]))
cnt=0
for aa in range(a+1):
    for bb in range(b+1):
        for cc in range(c+1):
            if aa*500+bb*100+cc*50 == x:cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
n=4
li=[int(input()) for i in range(n)]
a=li[0]
b=li[1]
c=li[2]
x=li[3]

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

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

L = []

a = 0
b = 0
c = 0
count = 0

for i in range((X // 500) + 1):
    a = i
    for j in range(((X - 500 * i) // 100) + 1):
        b = j
        c = int((X - 500 * a - 100 * b) / 50)
        L.append([a, b, c])

for i in L:
    if i[0] <= A and i[1] <= B and i[2] <= 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 i in range(a+1):
    for j in range(b+1):
        if (x-500*i-100*j)%50==0 and (x-500*i-100*j)//50<=c and (x-500*i-100*j)>=0:
            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 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
#abc087 b-coins
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:
# coding: utf-8
# Your code here!
a = int(input())
b = int(input())
c = int(input())
money = int(input())
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys


def main(argv=sys.argv):
  a = int(input())
  b = int(input())
  c = int(input())
  x = int(input())
  
  ans = 0
  
  for i in range(a+1):
    for j in range(b+1):
      for k in range(c+1):
        if (500*i + 100*j + 50*k) == x:
          ans += 1
  
  print(ans)
  
  return 0


if __name__ == '__main__':
  sys.exit(main())

Submission status: Accepted

Solution code:
# coding: utf-8
import sys


def main(argv=sys.argv):

    number_of_500 = int(input())
    number_of_100 = int(input())
    number_of_50 = int(input())
    total_amount = int(input())

    number_of_cases = 0
    for counter_of_500 in range(number_of_500 + 1):
        for counter_of_100 in range(number_of_100 + 1):
            for counter_of_50 in range(number_of_50 + 1):
                if counter_of_500 * 500 + counter_of_100 * 100 + counter_of_50 * 50 \
                        == total_amount:
                    number_of_cases += 1

    print(number_of_cases)

    return 0


if __name__ == '__main__':
    sys.exit(main())

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

Submission status: Accepted

Solution code:
num500 = int(input())
num100 = int(input())
num50 = int(input())
amount = int(input())
rst = 0
for itr500 in range(num500+1):
    for itr100 in range(num100+1):
        for itr50 in range(num50+1):
            kingaku = itr50*50+itr100*100+itr500*500
            #print("itersは50¥", itr50, "100¥", itr100, "500¥", itr500)
            #print(kingaku)
            if(kingaku==amount):
                rst += 1
print(rst)

Submission status: Accepted

Solution code:


five_handred = int(input())
handred = int(input())
fifty = int(input())

target = int(input())

count = 0

for i in range(min(five_handred, int(target/500)) + 1):

    y = target - 500 * i

    for j in range(min(handred, int(y/100)) + 1):

        z = y - 100 * j

        if int(z/50) <= fifty:
            count += 1

        else:
            pass

print(count)

Submission status: Accepted

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

sum=0

d=int(x/500)

for i in range(min(a,d)+1):
    #500coin i

    y=x-500*i

    e=int(y/100)
    for j in range(min(b,e)+1):
        #100coin j
        z=y-100*j

        w=int(z/50)

        if w<=c:
            sum+=1
        else:
            pass

print(sum)

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 a*500+b*100+c*50==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 g in range(b + 1):
    for h in range(c + 1):
      if i*500 + g*100 + h*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 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 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:
                count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

a, b, c, x = map(int, sys.stdin.read().split())
x //= 50

def main():
    ways = 0
    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if 10*i + 2*j + k == x:
                    ways += 1
    return ways

if __name__ == '__main__':
    ans = main()
    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==500*i+100*j+50*k:
        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_child in range(0, a + 1):
    x_child = x - 500 * a_child
    for b_child in range(0, b + 1):
        x_child_child = x_child - 100 * b_child
        for c_child in range(0, c + 1):
            x_child_child_child = x_child_child - 50 * c_child
            if x_child_child_child == 0:
                count += 1
                # print(a_child,b_child,c_child)
            
print(count)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())

def coin_check(coin_total, total):
    if coin_total==total:
        return 1
    else:
        return 0

count = 0
for i in range(coin_500 + 1):
    for j in range(coin_100 + 1):
        for k in range(coin_50 + 1):
            coin_total = i*500 + j*100 + k*50
            count+=coin_check(coin_total, total)
print(count)

Submission status: Accepted

Solution code:
u = [int(input()) for i in range(4)]
A,B,C,X = u[0],u[1],u[2],u[3]
count=[]
a ,b = 0,0
i = 0
while X-500*a >=0 and a<= A:
    X_1 = X-500*a
    while X_1-100*b>= 0 and b<= B:
        X_2 = X_1-100*b
        if X_2 % 50 == 0 and X_2 / 50 <= C:
            i += 1
        else:
             pass
        b += 1
    b = 0
    count.append(i)
    a += 1
    i=0
print(sum(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 = int(input())
b = int(input())
c = int(input())
x = int(input())
s = 0
num = 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:
        num += 1
      if s > x:
        break
    if s>x:
      continue
  if s>x:
    continue
print(num)

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, 1):
    for b in range(0, B+1, 1):
        for c in range(0, C+1, 1):
            if (a*500+100*b+50*c)==X:
                count = count + 1

print(count)

Submission status: Accepted

Solution code:
a,b,c,x=map(int,open(0).read().split())
cnt=0
#O(n**3)=O(50**3)=O(125000)
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k==x:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
A = int(input()) # 500
B = int(input()) # 100
C = int(input()) # 50
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())

i = 0
j = 0
k = 0
list_all = []

for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            list_all.append((500*i + 100*j + 50 *k))
count = 0
for l in list_all:
    if l == X:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num_Coin500 = int(input())
num_Coin100 = int(input())
num_Coin50 = int(input())
total = int(input())

count = 0

for i_Coin500 in range(num_Coin500 + 1):
    for i_Coin100 in range(num_Coin100 + 1):
        for i_Coin50 in range(num_Coin50 + 1):
            sum = 500*i_Coin500 + 100*i_Coin100 + 50*i_Coin50
            if total == sum:
                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 count500 in range(a+1):
    for count100 in range(b+1):
        value = 500 * count500 + 100 * count100
        delta = x - value
        if delta < 0:
            break

        if delta % 50 == 0 and delta // 50 <= c:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:

fh = int(input())
oh = int(input())
ft = int(input())
om = int(input())
count = 0

for i in range(fh + 1):
    if om < i * 500:
        break
    for j in range(oh + 1):
        if om < i * 500 + j * 100:
            break
        for k in range(ft + 1):
            nm = 0
            nm = i * 500 + j * 100 + k * 50
            if om == nm:
                count +=1

print(count)

Submission status: Accepted

Solution code:
fh = int(input())
oh = int(input())
ft = int(input())
om = int(input())
count = 0

for i in range(fh + 1):
    for j in range(oh + 1):
        for k in range(ft + 1):
            nm = 0
            nm = i * 500 + j * 100 + k * 50
            if om == nm:
                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 (i*500)+(j*100)+(k*50)==x:
                ans+=1
print(ans)

Submission status: Accepted

Solution code:
import math
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
sum = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			sum = 50 * k + 100 * j + 500 * i
			if(sum == X):
				cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(4)]
ans = 0
for i in range(a[0]+1):
  for j in range(a[1]+1):
    for k in range(a[2]+1):
      if 500*i+100*j+50*k==a[3]:
        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 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 na in range(a+1):
  for nb in range(b+1):
    for nc in range(c+1):
      if na*500 + nb*100 + nc*50 ==x:
        ans += 1
print(ans)

Submission status: Accepted

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

#初期値
able_number=0

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

Submission status: Accepted

Solution code:
a, b, c, x = [int(input()) for p in range(4)]
counter = 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:
        counter +=1
print(counter)

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, B, C, X = [int(input()) for i in range(4)]
ans =0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i + 100*j + 50*k == X:
                ans += 1
                
print(ans)