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

Submission status: Accepted

Solution code:
gohya =int(input())
hya = int(input())
goju = int(input())
total = int(input())
count = 0
for gh in range(gohya+1):
	for hy in range(hya+1):
		for gj in range(goju+1):
			if 500*gh + 100*hy + 50*gj == total:
				count += 1
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
X = int(input())
Ans = 0
for i in range(0,A+1):
  for j in range(0,B+1):
    for k  in range(0,C+1):
      if 500*i + 100*j + 50*k == X:
        Ans += 1
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = int(input()),int(input()),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 = 0
      total = 500*i + 100*j + 50*k
      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 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 = ans + 1 

print(ans)

Submission status: Accepted

Solution code:
li = [int(input()) for i in range(4)]
counter = 0
for p in range(li[0]+1):
  for q in range(li[1]+1):
    for r in range(li[2]+1):
      if 500*p+100*q+50*r == li[3]:
        counter+=1
print(counter)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
number = [int(input()) for i in range(3)]  # コイン枚数の上限
x = int(input())   # 合計金額

a=0
b=0
c=0
ans = 0

for i in range(number[0]+1):
    a = i
    for k in range(number[1]+1):
        b = k
        for l in range(number[2]+1):
            c = l 
            if x ==500*a + 100*b + 50*c:
                ans += 1
            else:
                pass

print(ans)

Submission status: Accepted

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


def solve(A: int, B: int, C: int, X: int):
    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)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(A, B, C, X)

if __name__ == '__main__':
    main()

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

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:
c500 = int(input())
c100 = int(input())
c50 = int(input())
price = int(input())
ans = 0

for i in range(c500+1):
    for j in range(c100+1):
        for k in range(c50+1):
            if 500*i + 100*j + 50*k == price:
                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 X == i*500+j*100+k*50:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
A, B, C, X = map(int,open(0).read().split())
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())
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())
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())
# print(a, b, c, x)

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

print(ans)

Submission status: Accepted

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

n = 0
for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            t = i * 500 + j * 100 + k * 50
            if t == x:
                n += 1


print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A500 = int(input())
B100 = int(input())
C50 = int(input())
X = int(input())

num = 0 # 組み合わせ数

for a500 in range(A500+1):
    sum500 = a500 * 500
    #print(sum500)
    if sum500 > X:
        break
    elif sum500 == X:
        num += 1
        #print('kita')
        break

    for b100 in range(B100+1):
        sum100 = sum500 + b100 * 100
        #print(sum100)
        if sum100 > X:
            break
        elif sum100 == X:
            num += 1
            #print('kita')
            break

        for c50 in range(C50+1):
            sum50 = sum100 + c50 * 50
            #print(sum50)
            if sum50 > X:
                break
            elif sum50 == X:
                num += 1
                #print('kita')
                break

print(num)

Submission status: Accepted

Solution code:
A=int(input())  #500の枚数
B=int(input())  #100の枚数
C=int(input())  #50の枚数
X=int(input())  #合計金額
num=0
#(i,j,k)
for i in range(0,A+1):
    Y=X-500*i
    for j in range(0,B+1):
        Z=Y-100*j
        for k in range(0,C+1):
            W=Z-50*k
            if W==0:
#                print(i,j,k)
                num=num+1
            else: 
                num=num+0
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_num = int(input())
B_num = int(input())
C_num = int(input())
X_value = int(input()) # 50の倍数

A_value = 500
B_value = 100
C_value = 50

counter = 0
for i in range(A_num+1):
    remain_value1 = X_value - i * A_value
    if remain_value1 == 0:
        counter += 1
    elif remain_value1 < 0:
        break
    else:
        for j in range(B_num+1):
            remain_value2 = remain_value1 - j * B_value
            if remain_value2 == 0:
                counter += 1
            elif remain_value2 < 0:
                break
            else:
                for k in range(C_num+1):
                    remain_value3 = remain_value2 - k * C_value
                    if remain_value3 == 0:
                        counter += 1
                    elif remain_value3 < 0:
                        break
            
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 = 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):
			s = 500 * i + 100*j + 50*k
			if s == x:
				cnt += 1
print (cnt)

Submission status: Accepted

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


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

print(result)

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,b,c,x = [int(input()) for _ in range(4)]

x = x // 50
if 10 * a + 2 * b + c < x:
    print(0)
    quit()

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

print(count)

Submission status: Accepted

Solution code:
import itertools

cnt_500 = int(input())
cnt_100 = int(input())
cnt_50 = int(input())
target_amount = int(input())

cnt_500_arr = [i for i in range(cnt_500+1)]
cnt_100_arr = [i for i in range(cnt_100+1)]
cnt_50_arr = [i for i in range(cnt_50+1)]

coin_combinations = list(itertools.product(cnt_500_arr, cnt_100_arr, cnt_50_arr))

result_count = 0
for cnt_500, cnt_100, cnt_50 in coin_combinations:
	amount = cnt_500 * 500 + cnt_100 * 100 + cnt_50 * 50
	if amount == target_amount:
		result_count += 1
print(result_count)

Submission status: Accepted

Solution code:
# coding=utf-8
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for coin500 in range(A + 1):
 for coin100 in range(B + 1):
  for coin50 in range(C + 1):
   if coin50 * 50 + coin100 * 100 + coin500 * 500 == 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 coin500 in range(A + 1):
    for coin100 in range(B + 1):
        for coin50 in range(C + 1):
            if coin50 * 50 + coin100 * 100 + coin500 * 500 == 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 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:
# -*- coding: utf-8 -*-
a = int(input())  # 500yen
b = int(input())  # 100yen
c = int(input())  # 50yen
x = int(input())
pattern = 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:
        pattern += 1

print(pattern)

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

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:
fiveh_num = int(input())
oneh_num = int(input())
ften_num = int(input())
sum = int(input())

count = 0

for x in range(0,fiveh_num+1):
  for y in range(0,oneh_num+1):
    for z in range(0,ften_num+1):
      ans = x*500 + y*100 + z*50
      if ans == sum:
        count += 1
      else:
        pass
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dbflag=""

def debug(*args):
  if ""!=dbflag: print(*args)

if ""!=dbflag: _INDATA=open(dbflag)

def readline():
  if ""!=dbflag:return _INDATA.readline()
  else: return input()


result = 0

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



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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

l = [500*i+100*j+50*k for i in range(a+1) for j in range(b+1) for k in range(c+1)]
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):
            money = i * 500 + j * 100 + k * 50
            if money == x:
                count += 1

print(count)

Submission status: Accepted

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

from itertools import permutations, combinations,combinations_with_replacement,product
lA = list(range(A+1))
lB = list(range(B+1))
lC = list(range(C+1))
L = product(*[lA,lB,lC]) #choufuku junretu2
cnt=0
for i in L:
  if (i[0]*500+i[1]*100+i[2]*50)==X:
    cnt+=1
print(cnt)

Submission status: Accepted

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

import numpy
import scipy

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

ok = 0
for i in range(A+1):
    m1 = X - 500*i
    if m1 >= 0:
        for j in range(B+1):
            m2 = m1 - 100*j
            if m2 >= 0:
                for k in range(C+1):
                    m3 = m2 - 50*k
                    if m3 == 0:
                        ok += 1
print(ok)

Submission status: Accepted

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

ans = 0
for i in reversed(range(a + 1)):
    for j in reversed(range(b + 1)):
        for k in reversed(range(c + 1)):
            if 500 * i + 100 * j + 50 * k == x:
                ans += 1

print(ans)

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):
        if (x-500*i-100*j)%50 == 0 and 0<= x-500*i-100*j <= 50*c:
            ans += 1
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
count = 0

while a < A+1:
	b = 0
	while b < B+1:
		c = 0
		while c < C+1:
			if 500 * a + 100 * b + 50 * c == X:
				count += 1
			c += 1
		b += 1
	a += 1
print(count)

Submission status: Accepted

Solution code:
def check(a, b, c, x):
    test = 500 * a + 100 * b + 50 * c
    if test > x:
        return 0
    elif test == x:
        return 1
    else:
        return 0

def resolve():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    
    result = 0
    #これは総当たり…
    for i in range(a, -1, -1):
        if 500 * i > x:
            continue
        for j in range(b, -1, -1):
            if 500 * i + 100 * j > x:
                continue
            for k in range(c, -1, -1):
                if 500 * i + 100 * j + 50 * k > x:
                    continue
                result += check(i, j, k, x)
    print(result)
resolve()

Submission status: Accepted

Solution code:
A,B,C,X = [int(input()) for i in range(4)]
cnt = 0
for a in range(A+1):
    for b in range(B+1):
        abx = X-(a*500+b*100)
        if abx < 0:break
        if abx%50==0 and abx//50 <= C:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
a = int(input()) # \500
b = int(input()) # \100
c = int(input()) #  \50
x = int(input())

# 0 <= a,b,c <= 50 -> Order = 50*50*50
# 力技で全探索でも計算量的には余裕で間に合う.
cnt = 0
for i1 in range(a+1):
    for i2 in range(b+1):
        for i3 in range(c+1):
            if i1 * 500 + i2 * 100 + i3 * 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(input())
B=int(input())
C=int(input())
X=int(input())
c=0 # 場合の数、これからインクリメント

for a in range(0,min(A+1,X//500+1)): # 500円玉
    resa=X-500*a # 100円玉、50円玉で払うべき金額

    for b in range(0,min(B+1,resa//100+1)): # 100円玉
        resb=resa-100*b # 50円玉で払うべき金額

        if resb/50<=C: # 残りを50円玉で払える場合OK
            # print("a, b, resb = ",a,b,resb)
            c+=1

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

print(s)

Submission status: Accepted

Solution code:
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
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())    #500円
B = int(input())    #100円
C = int(input())    #50円
X = int(input())

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

print(num)

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:
# atcoder : python3 (3.4.3)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7

# main
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:
# -*- coding: utf-8 -*-
# A=500,B=100,C=50

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

for ia in range(a+1):
    for ib in range(b+1):
        for ic in range(c+1):
            s = ia * 500 + ib * 100 + ic * 50
            if s == x:
                cou += 1
print(cou)

Submission status: Accepted

Solution code:
def judge(A,B,C,X):
    count = 0
    for n in range(A+1):
        for l in range(B+1):
            for m in range(C+1):
                if X == 500*n+100*l+50*m:
                    count += 1
    print(count)
    
A = int(input())
B = int(input())
C = int(input())
X = int(input())
judge(A,B,C,X)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
counter=0
for i in range(min(a+1,(x//500)+1)):
	for j in range(min(b+1,(x//100)+1)):
		if c*50>=(x-(500*i+100*j))>=0:
			counter+=1
print(counter)

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

Submission status: Accepted

Solution code:
#87b
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

#50*50*50=125000≒1*10**5なので間に合う
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, 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):
            total = 500 * i + 100 * j + 50 * k
            if total == 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):
            price = i*500 + j*100 + k*50 
            if price == X:
                count += 1
            price = 0
 
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())
count = 0
for l in range(a+1):
    for m in range(b+1):
        for n in range(c+1):
            if 500*l+100*m+50*n == 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())
result = 0

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

for l in range(A + 1):
    for m in range(B + 1):
        for n in range(C + 1):
            if sum(l,m,n) == X:
                result += 1

print(result)

Submission status: Accepted

Solution code:
import itertools

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

n = 0
for i,j,k in itertools.product(range(A+1),range(B+1),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())

count_combination = 0

for a_i in range(a + 1):
    for b_i in range(b + 1):
        for c_i in range(c + 1):
            sum_coins = 500 * a_i + 100 * b_i + 50 * c_i
            if sum_coins == x:
                count_combination += 1
            elif sum_coins > x:
                break
print(count_combination)

Submission status: Accepted

Solution code:
def examB():
    A = I(); B = I(); C = I(); X = I()
    ans = 0
    for i in range(min(41,A+1)):
        for j in range(B+1):
            for k in range(C+1):
                cur = 500*i + 100*j + 50*k
                if cur==X:
                    ans +=1
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

Solution code:
A = int(input())+1
B = int(input())+1
C = int(input())+1
X = int(input())
count = 0
for x in range(A):
  for y in range(B):
    for z in range(C):
      if x*500 + y*100 + z*50 == X:
        count += 1
      else:
        pass
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 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:
from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np

a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
c = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
kai = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500+j*100+50*k == x:
                kai += 1

print(kai)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 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:
                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):
      tmp = i * 500 + j * 100 + k * 50
      if tmp == x:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
# A,B,C,Xを取得
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, B, C, X = [int(input()) for i in range(4)]

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

        # remain_num = X - (i * 500 + j * 100)
        # divisible = (remain_num % 50 == 0)
        #
        # if divisible and (remain_num / 50) > 0:
        #     counter += 1

print(counter)

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

answer = 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:
        answer += 1
      else:
        continue
print(answer)

Submission status: Accepted

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

cnt = 0

for num_A in [num_A for num_A in range(A + 1) if (num_A * 500 <= X)]:
    rest_XA = X - num_A * 500
    for num_B in [num_B for num_B in range(B + 1) if num_B * 100 <= rest_XA]:
        rest_XAB = rest_XA - num_B * 100
        if rest_XAB % 50 == 0 and rest_XAB <= C * 50:
            cnt += 1
print(cnt)