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

Submission status: Accepted

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


count = 0
for x in range(a+1):
	for y in range(b+1):
		for z in range(c+1):
			count += 1 if( X == (500 * x + 100 * y + 50 * z)) else +0
#			print((500 * x + 100 * y + 50 * z))
#			print(x)
#			print(y)
#			print(z)
print(count)

Submission status: Accepted

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

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

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 = [int(input()) for _ in range(4)]
print(len([1 for a in range(A+1)
           for b in range(B+1) if 0 <= X-500*a-100*b <= C*50]))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
num=0
for i in range(a+1):
	x_i=x-500*i
	if x_i<0:
		break
	for j in range(b+1):
		#print('j:',j)
		x_j=x_i-100*j
		if x_j<0:
			break
		if x_j/50<=c:
			num+=1
			#print(x_j)
print(num)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abs/tasks/abc087_b

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

ans = 0

n_500 = min(x // 500, a)
for i in range(n_500 + 1):
    remainder_500 = x - 500 * i    
    n_100 = min(remainder_500 // 100, b)
    for j in range(n_100 + 1):
        remainder_100 = remainder_500 - 100 * j
        # n_50 = min(remainder_100 // 50, c)
        if remainder_100 // 50 <= c:
            # print(i, j, remainder_100 / 5)
            ans += 1
        
print(ans)

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):
        c = X//50-10*a-2*b
        if 0 <= c and c <= C:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
def coins():
    import itertools

    A = [i for i in range(int(input())+1)]
    B = [i for i in range(int(input())+1)]
    C = [i for i in range(int(input())+1)]
    X = int(input())

    p = list(itertools.product(A,B,C))
    count = 0
    for i in p:
        sum = 500*i[0] + 100*i[1] + 50*i[2]
        if sum == X:
            count+=1

    print(count)

if __name__ == "__main__":
    coins()

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

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
l = [0] * ((a + 1) * (b + 1) * (c + 1))
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            index = (b + 1) * (c + 1) * i + (c + 1) * j + k
            l[index] = 500 * i + 100 * j + 50 * k

result = l.count(x)
print(result)

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

ans = 0
for n_500yen in range(int(min(X/500, A)+1)):  # 500円玉使用数。0枚時も含む
    for n_100yen in range(int(min(X/100, B)+1)):  # 100円玉使用数。0枚時も含む
        for n_50yen in range(int(min(X/50, C)+1)):  # 50円玉使用数。0枚時も含む
            if n_500yen*500+n_100yen*100+n_50yen*50 == X:
                ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:




def main():

    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)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# 自分の回答
a = int(input())
b = int(input())
c = int(input())
x = int(input())

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

print(ptn)

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

Submission status: Accepted

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

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())
ans = 0


for i in range(A + 1):
    for j in range(B + 1):
        temp = X - (500 * i + 100 * j)
        if temp // 50 > C or temp < 0:
            continue
        else:
            ans += 1

print(ans)

Submission status: Accepted

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


for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            ans.append(500 * i + 100 * j + 50 * k)

print(ans.count(X))

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
strings = 'k:'

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      # print('i = %s, j = %s, k = %s' %(i,j,k))
      if i * 500 + j * 100 + k * 50 == x:
        # print(x)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c,x = (int(input()) for i in range(4))
print(sum([1 for q in range(a+1) for w in range(b+1) for e in range(c+1) if 500*q+100*w+50*e == x]))

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counter = 0
for s in range(1 + min(a, x//500)):
	for t in range(1 + min(b, (x-500*s)//100)):
		money = 500*s + 100*t
		amari = x - money
		if amari % 50 == 0 and amari <= 50 * c:
			counter += 1
print(counter)

Submission status: Accepted

Solution code:
#A=500円の枚数、B=100円の枚数,C=50円玉の枚数,X=お年玉の金額
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:
#Coins
A,B,C,X=map(int,open(0).read().split())
c = 0
for k in range(A+1):
    Y = X - 500*k
    for l in range(B+1):
        Z = Y - 100*l
        for m in range(C+1):
            U = Z - 50*m
            if U == 0:
                c += 1
print(c)

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 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==0:
        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(min(x//500 + 1,a + 1)):
    for j in range(min((x-i*500)//100 + 1,b + 1)):
        if (x-i*500-j*100)%50==0 and (x-i*500-j*100)//50 <= c:
            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 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())

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

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

a = ni()
b = ni()
c = ni()
x = ni()
ans = 0
for ai in range(a+1):
        for bi in range(b+1):
                if (x - 500 * ai - 100 * bi) % 50 == 0 \
                        and (x - 500 * ai - 100 * bi) // 50 <= c \
                                and (x - 500 * ai - 100 * bi) // 50 >= 0:
                        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(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())
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:
# -*- coding: utf-8 -*-

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

# solve
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

# output
print(ans)

Submission status: Accepted

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

a = 0
b = 0
c = 0
n=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 :
                n+=1
        c=0
    b=0

if 0 == X :
    n+=1

print(n)

Submission status: Accepted

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

ways = 0

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

print(ways)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(sum([ _a * 500 + _b * 100 + _c * 50 == 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 = int(input())
B = int(input())
C = int(input())
x = int(input())
print(sum([1 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]))

Submission status: Accepted

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

count = 0
if x % 50 != 0:
    print(0)
else:
    for c in range(C+1):
        for b in range(B+1):
            for a in range(A+1):
                if c*50 + b*100 + a*500 == 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 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)]
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, 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=["","",""]
for i in range(3):
    a[i]=int(input())
x=int(input())
cnt=0
for i in range(a[0]+1):
    for j in range(a[1]+1):
        for k in range(a[2]+1):
            ans = x-500*i - 100*j - 50*k
            if ans==0:
                cnt+=1
print(cnt)

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

Submission status: Accepted

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

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
sum = 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 X == sum:
                count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
a = 0

while a <= A and a * 500 <= X:
	b = 0
	while b <= B and a * 500 + b * 100 <= X:
		if (X - 500 * a - 100 * b) // 50 <= C:
			ans += 1
		b += 1
	a += 1

print(ans)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
Ans=0
for x in range(A+1):
  for y in range(B+1):
    for z in range(C+1):
      if 500*x + 100*y + 50*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 a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if a * 500 + b * 100 + c * 50 == X:
                ans += 1
print(ans)

Submission status: Accepted

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

cnt = 0
for a_i in range(a + 1):
    for b_i in range(b + 1):
        for c_i in range(c + 1):
            if x == 500 * a_i + 100 * b_i + 50 * c_i:
                cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

tmp_sum = 0
for i in range(0, A+1):
    for j in range(0, B+1):
        for k in range(0, C+1):
            tmp_sum = 500 * i + 100 * j + 50 * k
            if tmp_sum == X:
                X_match_cnt += 1
                break
            elif tmp_sum > X:
                break
            else:
                continue

print(X_match_cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Coins
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())

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

Submission status: Accepted

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

cnt = 0
for i in range(a + 1):
    ai = i * 500
    if x < ai:
        continue
    for j in range(b + 1):
        bj = j * 100
        if x < bj:
            continue
        for k in range(c + 1):
            ck = k * 50
            if x < ck:
                continue
            total = sum([ai, bj, ck])
            if total == 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):
            x=500*a+100*b+50*c
            if x==X:
                cnt+=1
            else:
                cnt=cnt
print(cnt)

Submission status: Accepted

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

ans = 0

c500 = X // 500

if c500 > A:
    c500 = A

for i in range(c500 + 1):
    c100 = (X - i*500) // 100
    if c100 > B:
        c100 = B
    for j in range(c100 + 1):
        c50 = (X - i*500 - j*100) // 50
        if c50 <= C:
           ans += 1

print(ans)

Submission status: Accepted

Solution code:
a,b,c,x=map(int,open(0));print(sum(1for i in range(a+1)for j in range(b+1)for k in range(c+1)if i*10+j*2+k==x/50))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B, C, X = [int(input()) for _ in range(4)]
        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)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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

count=0
for d in range(A+1):
  for e in range(B+1):
    for f in range(C+1):
      total = 500*d + 100*e +50*f
      if total == X:
      	count +=1

print(count)

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

print(result)

Submission status: Accepted

Solution code:
a_500 = int(input())
b_100 = int(input())
c_50 = int(input())
x_total = int(input())

counter = 0
for i in range(a_500 + 1):
    for j in range(b_100 + 1):
        for k in range(c_50 + 1):
            if x_total == i*500 + j*100 + k*50:
                counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

for i in range(a+1):
    y = x-500 * i
    if y >= 0:
        for j in range(b+1):
            z = y-100*j
            k = int(z/50)
            if k <= c and k >= 0:
                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):
        q = (X - (500 * a + 100 * b)) / 50
        if q >= 0 and q <= C:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c,x=map(int,open(0));d=0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
				d+=i*500+j*100+k*50==x
print(d)

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