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:
import sys

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_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(str(ans))

Submission status: Accepted

Solution code:
import sys

a = int(sys.stdin.readline().strip())
b = int(sys.stdin.readline().strip())
c = int(sys.stdin.readline().strip())
x = int(sys.stdin.readline().strip())

max_500 = int(x/500)
max_500 = min(max_500, a)

count = 0
for i in range(max_500 + 1):
    res = x - 500 * i
    max_100 = int(res/100)
    max_100 = min(max_100, b)
    for j in range(max_100 + 1):
        num_50 = int((res - 100 * j)/50)
        if num_50 <= c:
            count += 1
print(count)

Submission status: Accepted

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

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:
a,b,c,x = [int(input()) for i in [0]*4]
p_A = [p*500 for p in range(1,a+1)]
p_B = [q*100 for q in range(1,b+1)]
p_C = [r*50 for r in range(1,c+1)]

list_AB = sum([sum([1 for j in p_B if i+j == x]) for i in p_A])
list_BC = sum([sum([1 for j in p_C if i+j == x]) for i in p_B])
list_CA = sum([sum([1 for j in p_A if i+j == x]) for i in p_C])
list_ABC = sum([sum([sum([1 for k in p_C if i+j+k == x]) for j in p_B]) for i in p_A])
a_1 = sum([[0,1][x in i] for i in (p_A,p_B,p_C)])

print(a_1 + list_AB + list_BC + list_CA + list_ABC)

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):
            total = 500*i + 100*j + 50*k
            if total == x:
                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 = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Submission status: Accepted

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

pattern = 0
for ai in range(A+1):
    for bi in range(B+1):
        for ci in range(C+1):
            if X == 500 * ai + 100 * bi + 50 * ci:
                pattern = pattern + 1
print(pattern)

Submission status: Accepted

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

print(a)

Submission status: Accepted

Solution code:
num1=int(input())
num2=int(input())
num3=int(input())
sum_n=int(input())
#print(num1,num2,num3,sum_n)
a=0
for i in range(num1+1):
    sum_n1=sum_n-500*i
    #print(sum_n1)
    if sum_n1<0:
        break
    for i in range(num2+1):
        sum_n2=sum_n1-100*i
        if sum_n2<0:
            break
        for i in range(num3+1):
            if i==sum_n2/50:
                a+=1
                #print(True)
print(a)

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, B, C, X = map(int, [input() for _ in range(4)])
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:
def Amount(i, j, k):
    return 500*i + 100*j + 50*k

#A=500, B=100, C=50
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==Amount(i,j,k)):
                count = 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 500 * a + 100 * b + 50 * c == 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());
n = 0;
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            re = 500 * i + 100 * j + 50 * k;
            if ( re == x ):
                n += 1;
            if ( re >= x ):
                re = 0;
                continue;

print(n);

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

print(ans)

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

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

print(ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a = ni()
b = ni()
c = ni()
x = ni()

ans = 0

for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            if 500*ai + 100*bi + 50*ci == 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):
            t = 500*i + 100*j + 50*k
            if t == x:
                res += 1
print(res)

Submission status: Accepted

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

a = int(input()) #500
b = int(input()) #100
c = int(input()) #50
x = int(input()) #target

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 x == total:
                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:
## ABC 087
## B. coins
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 = i*500+j*100+k*50
            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 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:
				ans += 1
print(ans)

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 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()), int(input()), int(input()), int(input())
ans = 0
for i in range(a + 1):
    for f in range(b + 1):
        for j in range(c + 1):
            if 500 * i + 100 * f + 50 * j == 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):
        temp = x - 500 * a - 100 * b
        if temp % 50 != 0 or temp < 0:
            continue
        if temp // 50 <= C:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
n = 0
ans = 0
for i in range(b+1):
  for j in range(c+1):
    n = x - 100*i - 50*j 
    if n % 500 == 0 and 0 <= n//500 <= a:
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8

import sys


input = sys.stdin.readline
INF = float('inf')


def inpl(): return list(map(int, input().split()))


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

ans = 0
for a in range(X[0] + 1):
    for b in range(X[1] + 1):
        tmp = X[3] - 500 * a - 100 * b
        q, mod = divmod(tmp, 50)
        if mod != 0 or tmp < 0:
            continue
        if q <= X[2]:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
a = int(input()) #10
b = int(input()) #2
c = int(input()) #1
x = int(input())/50

ans=0
for p in range(0,a+1):
    for q in range(0,b+1):
        if x-c<=10*p+2*q and 10*p+2*q<=x:
            ans = 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())
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())
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:
def answer(*inp):

    A = int(inp[0])
    B = int(inp[1])
    C = int(inp[2])
    X = int(inp[3])

    cnt = 0

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

    print(cnt)

answer(input(), input(), input(), input())

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

Submission status: Accepted

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

for i in range(fh+1):
    for n in range(oh+1):
        for s in range(ft+1):
             if 500*i+100*n+50*s == to:
                 count += 1
print(count)

Submission status: Accepted

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

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 c in range(0, C+1):
    for b in range(0, B+1):
        for a in range(0, A+1):
            if c*50 + b*100 + a*500 == 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 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 ia in range(0, min((x//500)+1,a+1)):
    y = x-500*ia
    for ib in range(0, min((y//100)+1, b+1)):
        z = y-100*ib
        if z%50 == 0 and z//50 <= c:
            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):
    j=0
    for j in range(0,b+1):
        k=0
        for k in range(0,c+1):
            if 500*i+100*j+50*k==x:
                count+=1
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

n500 = int(stdin.readline().rstrip())
n100 = int(stdin.readline().rstrip())
n50 = int(stdin.readline().rstrip())
yen = int(stdin.readline().rstrip())

x = 0

for a in range(n500+1):
    for b in range(n100+1):
        for c in range(n50+1):
            if yen == a*500+ b*100+ c*50: 
                x += 1

print(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 (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:
num_500 = int(input())
num_100 = int(input())
num_50 = int(input())
X = int(input())
count = 0
for i in range(0, num_500 + 1):
  for n in range(0, num_100 + 1):
    for m in range(0, num_50 + 1):
      if (i*500 + n*100 + m*50) == X:
        count += 1
print(count)

Submission status: Accepted

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

money = []
for a_i in range(a+1):
	for b_i in range(b+1):
		for c_i in range(c+1):
			money.append(500*a_i+100*b_i+50*c_i)

cnt = 0
for m in money:
	if m == 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 ia in range(a+1):
    for ib in range(b+1):
        for ic in range(c+1):
            num = 500*ia+100*ib+50*ic
            if num==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())

ans = 0

for k in range(a+1):
    for l in range(b+1):
        for m in range(c+1):
            total = 500 * k + 100 * l + 50 * m
            if total == 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 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_origin = int(input())
i = 0
ans = 0
while i <= a:
    x_aftera = x_origin - 500 * i
    if x_aftera < 0:
        break
    j = 0
    while j <= b:
        x_afterb = x_aftera - 100 * j
        if x_afterb < 0:
            break
        if x_afterb // 50 <= c:
            ans += 1
        j += 1
    i += 1
print(ans)

Submission status: Accepted

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

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

print(n_combinations)

Submission status: Accepted

Solution code:
c = int(input())  # 1
b = int(input())  # 2
a = int(input())  # 10
x = int(input()) // 50
ans = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if x == i + 2 * j + 10 * k:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
m=int(input())
s=0
for i in range(a+1):
  for j in range(b+1):
    x,y=divmod(m-i*500-j*100,50)
    if y==0 and 0<=x<=c:
      s+=1
print(s)

Submission status: Accepted

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

count = 0

a = 0
while a <= A:
  b = 0
  while b <= B:
    r = X - 10*a - 2*b
    if r >= 0 and r <= C:
      count += 1
    b += 1
  a += 1

print(count)

Submission status: Accepted

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

index1 =0
count =0
while index1<a+1:
    sum1 =0
    index2=0
    sum1+=500*index1
    while index2<b+1:
        sum2=0
        index3=0
        sum2+=100*index2
        while index3<c+1:
            sum3=0
            sum3+=50*index3
            if sum1+sum2+sum3==x:
                count+=1
            index3+=1
        index2+=1
    index1+=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 (x == (500 * i + 100 * j + 50 * k)):
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
ans = 0
A = int(input()) + 1
B = int(input()) + 1
C = int(input()) + 1
X = int(input())
for a in range(A):
    for b in range(B):
        for c in range(C):
            if (500 * a + 100 * b + 50 * c == X):
                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 a == 0 and b == 0 and c == 0:
                continue
            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(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            sum = i * 500 + j * 100 + k * 50
            if sum == X:
                count += 1

print(count)

Submission status: Accepted

Solution code:
#AtCoder Begginer Contest 087 B Coins

a = int(input()) #counts of 500
b = int(input()) #counts of 100
c = int(input()) #counts of 50
x = int(input()) #total value

cnt = 0

def judge(x,a,b,c):
    if 500*a + 100 * b + 50*c == x:
        return True
    
for i in reversed(range(a+1)):
    if judge(x, i, 0, 0):
                cnt += 1
                continue
    for j in reversed(range(b+1)):
        if judge(x, i, j, 0):
                cnt += 1
                continue
        for k in reversed(range(c+1)):
            if judge(x, i, j, k):
                cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#AtCoder Begginer Contest 087 B Coins

a = int(input()) #counts of 500
b = int(input()) #counts of 100
c = int(input()) #counts of 50
x = int(input()) #total value

cnt = 0

def judge(x,a,b,c):
    if 500*a + 100 * b + 50*c == x:
        return True
    
for i in reversed(range(a+1)):
    for j in reversed(range(b+1)):
        for k in reversed(range(c+1)):
            if judge(x, i, j, k):
                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:
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 = i*500 + j*100 + k*50
      if total == 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 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 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:
        count+=1
      else:
        continue
        
print(count)

Submission status: Accepted

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

ans = 0

for num_a in range(0, a + 1):
  for num_b in range(0, b + 1):
    for num_c in range(0, c + 1):
      if 500 * num_a + 100 * num_b + 50 * num_c == x:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
L = []
answer = 0
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)
for l in range(len(L)) :
    if X-L[l] == 0 :
        answer += 1
print(answer)

Submission status: Accepted

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

sum = 0
count = 0
for a in range(A+1):
    sum = 0
    sum = sum + a * 500
# if X >500, then no need to check 500*2
    if sum > X:
        break
    for b in range(B+1):
        sum2 = sum
        sum2 = sum2 + b * 100
        if sum2 > X:
            break
# number of C is dtermined by a and b
        if (X - sum2) / 50  <= C:
            count = count +1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
k = 0
for p in range(A+1):
  for q in range(B+1):
    for r in range(C+1):
      if (10*p+2*q+r == X//50):
        k += 1
print(k)

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

print(cnt)

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

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

print(count)

Submission status: Accepted

Solution code:
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_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:
# -*- coding: utf-8 -*-
import math
a = int(input())
b = int(input())
c = int(input())
x = int(input())

f = 0
for ax in range(a + 1):
   for bx in range(b + 1):
      for cx in range(c + 1):
        if (ax*500+bx*100+cx*50 == x):
          f = f +1
print(f)

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

Submission status: Accepted

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

ok = set()

for a_num in range(a + 1):
    for b_num in range(b + 1):
        for c_num in range(c + 1):
            price = a_num * 500 + b_num * 100 + c_num * 50
            if price == x:
                ok.add((a_num, b_num, c_num))

print(len(ok))

Submission status: Accepted

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

count = 0
for aa in range(a+1) :
	for bb in range(b+1) :
		for cc in range(c+1):
			ans = aa * 500 + bb * 100 + cc * 50
			if ans == x :
				count += 1
print(count)

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

Submission status: Accepted

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

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

print n

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