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 = 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:
""" AtCoder """

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_500 = int(input().split()[0])
b_100 = int(input().split()[0])
c_50 = int(input().split()[0])
x = int(input().split()[0])

all_coins = []
count = 0

for a_n in range(a_500+1):
    for b_n in range(b_100+1):
        for c_n in range(c_50+1):
            total = 500*a_n + 100*b_n + 50*c_n
            if total == 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 x == 500*A + 100*B + 50*C:
                cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input()) #sum
count = 0

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

print(count)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("Three")
    else:print("Four")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())




#n = ip()                              #入力整数1つ
#a,b= (int(i) for i in input().split())      #入力整数横2つ
#k,a,b = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
a = ip()+1
b = ip()+1
c = ip()+1
x = ip()
sum = 0
for i in range(a):
    for l in  range(b):
        for m in range(c):
            if 500*i+100*l+50*m == x:sum+=1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

X //= 50
ans = 0
for a in range(A+1):
    for b in range(B+1):
        if 0 <= X - 10*a - 2*b <= C:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
X = int(input())
fifty = [x for x in range (0,X+1,500)][:a+1]
hundred = [x for x in range (0,X+1,100)][:b+1]
five_hundred = [x for x in range (0,X+1,50)][:c+1]
pattern = [x+y+z for x in fifty for y in hundred for z in five_hundred]
print(len(list(filter(lambda x:x==X,pattern))))

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

print(count)

Submission status: Accepted

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

comb = []
count = 0

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

print(count)

Submission status: Accepted

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

comb = []
count = 0

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

res = 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 == 0:
                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 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(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:
# -*- coding: utf-8 -*-

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

x = int(input())


pettern = 0
for i in range(0, a + 1):
    temp_x = x - (i * 500)

    if temp_x == 0:
        pettern += 1

    if temp_x <= 0:
        break

    # 500円玉を使った後のパターン
    for j in range(0, b + 1):
        temp_x2 = temp_x - (j * 100)

        if temp_x2 == 0:
            pettern += 1

        if temp_x2 <= 0:
            break

        # 100円玉を使った後のパターン
        for k in range(0, c + 1):
            temp_x3 = temp_x2 - (k * 50)

            if temp_x3 == 0:
                pettern += 1

            if temp_x3 <= 0:
                break

print(pettern)

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

ans = 0
for i_a in range(a + 1):
  for j_b in range(b + 1):
    for k_c in range(c + 1):
      sum = 500 * i_a + 100 * j_b + 50 * k_c
      if sum == x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
a,b,c,d = [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==d:
                ans += 1
print(ans)

Submission status: Accepted

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

for v_a in range(a+1):
    for v_b in range(b+1):
        for v_c in range(c+1):
            if v_a*500 + v_b*100 + v_c*50 == x:
                count += 1
print(count)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
q=int(input())
ans=0
for i in range(a+1):
  for k in range(b+1):
    for p in range(c+1):
      if 500*i+100*k+50*p==q:
        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(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())

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

print(c)

Submission status: Accepted

Solution code:
cnt500 = int(input())
cnt100 = int(input())
cnt50 = int(input())
X = int(input())

result = 0
for a in range(cnt500+1):
    for b in range(cnt100+1):
        for c in range(cnt50+1):
           if (a*500 + b*100 + c*50) == X:
               result += 1
print(result)

Submission status: Accepted

Solution code:
cnt500 = int(input())
cnt100 = int(input())
cnt50 = int(input())
X = int(input())

all = []
for a in range(cnt500+1):
    for b in range(cnt100+1):
        for c in range(cnt50+1):
            all.append(a*500 + b*100 + c*50)
print(all.count(X))

Submission status: Accepted

Solution code:
cnt500 = int(input())
cnt100 = int(input())
cnt50 = int(input())
X = int(input())

all_set = set([])

for a in range(cnt500+1):
    tmp500 = a*500
    if tmp500 > X:
        break
    all_set.add((tmp500, 0, 0))
    for b in range(cnt100+1):
        tmp100 = b*100
        if tmp100 > X:
            break
        all_set.add((tmp500, tmp100, 0))
        for c in range(cnt50+1):
            tmp50 = c*50
            if tmp50 > X:
                break
            all_set.add((tmp500, tmp100, tmp50))

all = []
for a in all_set:
    all.append(sum(a))
print(all.count(X))

Submission status: Accepted

Solution code:
cnt500 = int(input())
cnt100 = int(input())
cnt50 = int(input())
X = int(input())

all_set = set([])

for i,a in enumerate(range(cnt500+1)):
    tmp500 = i*500
    if tmp500 > X:
        break
    all_set.add((tmp500, 0, 0))
    for i,b in enumerate(range(cnt100+1)):
        tmp100 = i*100
        if tmp100 > X:
            break
        all_set.add((tmp500, tmp100, 0))
        for i,c in enumerate(range(cnt50+1)):
            tmp50 = i*50
            if tmp50 > X:
                break
            all_set.add((tmp500, tmp100, tmp50))

all = []
for a in all_set:
    all.append(sum(a))
print(all.count(X))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A_500 = int(input()) #10
B_100 = int(input()) #2
C_50 = int(input()) #1
X = int(input())


cnt = 0
for a in range(0,A_500+1):
    for b in range(0,B_100+1):
        for c in range(0,C_50+1):
            if a * 500 + b * 100 + c * 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:
Li = [int(input()) for _ in range(4)]
a, b, c, x = Li[0], Li[1], Li[2], Li[3]
ans = 0
for i in range(min(x//500, a)+1):
    for j in range(min((x-500*i)//100, b)+1):
        ans += 1 if (x-500*i-100*j)//50 <= c else 0
print(ans)

Submission status: Accepted

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

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

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

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

a_list = [0] if a==0 else range(a+1)
b_list = [0] if b==0 else range(b+1)
c_list = [0] if c==0 else range(c+1)    

count = 0

for n50 in c_list:
    s50 = 50*n50
    if s50==x:
        count += 1
    else:
        for n100 in b_list:
            s100 = s50+100*n100
            if s100==x:
                count += 1
            else:
                for n500 in a_list:
                    s500 = s100 + 500*n500
                    if s500==x:
                        count += 1
print(count)

Submission status: Accepted

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

if int(X // 500) < A:
    A = X // 500
if int(X // 100) < B:
    B = X // 100
if int(X // 50) < C:
    C = X // 50

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
            if X == sum:
                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):
            temp = i * 500 + j * 100 + k * 50
            if temp == 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 ai in range(A+1):
    for bi in range(B+1):
        for ci in range(C+1):
            total = 500*ai + 100*bi + 50*ci
            if total == X:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
gohyaku = int(input())
hyaku = int(input())
goju = int(input())
inp = int(input())
count = 0

for i in range(gohyaku+1):
	for k in range(hyaku+1):
		for j in range(goju+1):
			if i * 500+ k*100+j*50 == inp:
				count += 1
print(count)

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline

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):
            calc = (500 * i) + (100 * j) + (50 * k)
            if calc == 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):
    if 500*i > x:
        break
    for j in range(b+1):
        y = 500*i+100*j
        if y > x:
            break
        z = x - y
        if z // 50 <= c:
            cnt += 1
print(cnt)

Submission status: Accepted

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

amax = int(input())
bmax = int(input())
cmax = int(input())
x = int(input())

count = 0

for a in range(amax+1):
  for b in range(bmax+1):
    for c in range(cmax+1):
       if x == 500 * a + 100 * b + 50 * c:
        count+=1
        
print("{}".format(count))

Submission status: Accepted

Solution code:
import sys
import math

# -*- coding: utf-8 -*-

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

print(str(ret))

Submission status: Accepted

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

s = 0

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

print(s)

Submission status: Accepted

Solution code:
import sys
import math

A = int(sys.stdin.readline())
B = int(sys.stdin.readline())
C = int(sys.stdin.readline())
X = int(sys.stdin.readline())


cnt = 0
for a in range(A + 1):
    ta = 500 * a
    if ta > X:
        break
    for b in range(B + 1):
        tab = ta + 100 * b
        if tab > X:
            break
        for c in range(C + 1):
            tabc = tab + 50 * c
            if tabc > X:
                break
            if tabc == X:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A=int(raw_input())
B=int(raw_input())
C=int(raw_input())
X=int(raw_input())
r=0
for a in xrange(A+1):
  for b in xrange(B+1):
    for c in xrange(C+1):
      if 500*a+100*b+50*c==X:
        r+=1
print(r)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    A = int(raw_input())
    B = int(raw_input())
    C = int(raw_input())
    X = int(raw_input())

    count = 0

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

                if i*500 + j*100 + k*50 > X:
                    break

    print count

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 087
def getInt(): return int(input())
A = getInt()
B = getInt()
C = getInt()
X = getInt()
cnt = 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: cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def main():
    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)

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(min(X // 500, A)+1):
  Y = X - 500 * i
  for j in range(min(Y // 100, B)+1):
    Z = Y - 100 * j
    for k in range(min(Z // 50, C)+1):
      Q = Z - 50 * k
      if Q == 0:
        count += 1
      else:
        continue
print(count)

Submission status: Accepted

Solution code:
import itertools

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

count = 0
for aa, bb, cc in itertools.product(range(a + 1), range(b + 1), range(c + 1)):
    s = aa * 500 + bb * 100 + cc * 50
    if s == 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):
      amount = 500*i + 100*j + 50*k
      if amount ==x:
        ans +=1

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
ammount = 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 == ammount:
        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):
            total = i*500 + j*100 + k*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(min(x // 500, a) + 1):
    for j in range(min((x - i * 500) // 100, b) + 1):
        if x - i * 500 - j * 100 <= c * 50:
            count += 1
print(count)

Submission status: Accepted

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

ans = 0
for num500 in range(A+1):
    for num100 in range(B+1):
        for num50 in range(C+1):
            if 500*num500 + 100*num100 + 50*num50 == 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 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())
d = int(input())

res = 0

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

print (res)

Submission status: Accepted

Solution code:
# encoding:utf-8

import numpy as np
import random


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

answer = 0
cash = X

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


print(answer)

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())
count=0
for big in range(0,A+1):
    for middle in range(0,B+1):
        for mini in range(0,C+1):
            kakaku=big*500+middle*100+mini*50
            if kakaku==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(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:
def inpl(): return list(map(int, input().split()))


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

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

Submission status: Accepted

Solution code:
t = list(int(input()) for _ in range(3))
x = int(input())
c = 0
for i in range(min(x//500,t[0])+1):
    a = t[:]
    d = x-500*i
    if d <= 100*a[1]+50*a[2]:
        for j in range(a[1]+1):
            if d >= 100*j:
                r = d-100*j
                if r <= 50*a[2]:
                    c += 1
            else:
                break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for count_500 in range(A+1):
    for count_100 in range(B+1):
        for count_50 in range(C+1):
            sum_money = 500*count_500 + 100*count_100 + 50*count_50
            if sum_money == X:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
c500 = int(input())
c100 = int(input())
c50 = int(input())
sumX = int(input())
retCount = 0
chk500X = sumX
for i in range(c500+1):
  for j in range(c100+1):
    for k in range(c50+1):
      if sumX == 500*i + 100 * j + 50 * k:
        retCount += 1
print(retCount)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(A, B, C, X):
    # type: (int, int, int, int) -> None
    coins = [
        (a,b,c)
        for a in range(0,A+1)
        for b in range(0,B+1)
        for c in range(0,C+1)
        if 500*a + 100*b + 50*c == X
    ] # type: List[Tuple[int, int, int]]
    print(len(coins))

if __name__ == '__main__':
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    main(A,B,C,X)

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+j+k >= 1) and (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())

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

print(counter)

Submission status: Accepted

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

for ia in range(a+1):
    for jb in range(b+1):
        for kc in range(c+1):
            if(0 == (x - (ia*500 + jb*100 + kc*50))):
                count += 1

print(count)

Submission status: Accepted

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

print(r)

Submission status: Accepted

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

counter = 0

for i in range(0, a + 1):
    sum_a = i * 500
    if sum_a > x:
        continue
    for j in range(0, b + 1):
        sum_b = j * 100
        sum_ab = sum_a + sum_b
        if sum_ab > x:
            continue
        for k in range(0, c + 1):
            sum_c = k * 50
            sum_abc = sum_ab + sum_c
            if sum_abc > x:
                continue
            elif sum_abc == x:
                counter += 1

print(counter)

Submission status: Accepted

Solution code:
from itertools import product
A=int(input())
B=int(input())
C=int(input())
X=int(input())
ans=0
for a,b,c in product(range(0,A+1),range(0,B+1),range(0,C+1)):
  if X==500*a+100*b+50*c:
    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())

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

print(count(A, B, C))

Submission status: Accepted

Solution code:
### coding: UTF-8

#import math
#import random as rd
#import numpy as np

line=[]
line.append(int(input()))
line.append(int(input()))
line.append(int(input()))
X=int(input())

count=0

for i in range(line[0]+1):
    for j in range(line[1]+1):
        for k in range(line[2]+1):
            if 500*i+100*j+50*k == X:
                count+=1

print(count)

Submission status: Accepted

Solution code:
t=[int(input())for i in range(3)]
x=int(input())
c=0
for i in range(min(x//500,t[0])+1):
    a=t[:]
    d=x-500*i
    if d<=100*a[1]+50*a[2]:
        for j in range(a[1]+1):
            if d>=100*j:
                r=d-100*j
                if r<=50*a[2]:
                    c+=1
            else:
                break
print(c)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
a = 0
while a <= A:
    b = 0
    while b <= B:
        c = 0
        while c <= C:
            if 500*a+100*b+50*c == X:
                count+=1
            else:
                pass
            c+=1
        b+=1
    a+=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):
    ta = a * 500
    for b in range(B+1):
        tb = b * 100
        for c in range(C+1):
            if X == ta + tb + c*50:
                ans += 1

print(ans)