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:
l = [int(input()) for i in range(3)]
x = int(input())
count = 0
for i in range(l[0]+1):
  for j in range(l[1]+1):
    for k in range(l[2]+1):
      if 500*i+100*j+50*k == x:
        count += 1
print(count)

Submission status: Accepted

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

    cnt = 0
    for ia in range(A+1):
        for ib in range(B+1):
            for ic in range(C+1):
                if 500*ia + 100*ib + 50*ic == X: 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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for ai in range(a + 1):
  for bi in range(b + 1):
    for ci in range(c + 1):
      total = 500 * ai + 100 * bi + 50 * ci
      if x == total:
        res += 1
        
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n_500 = int(input())
n_100 = int(input())
n_50  = int(input())
X     = int(input())

n_comb = 0
for i in range(n_500+1):
  for j in range(n_100+1):
    for k in range(n_50+1):
      comb = i*500 + j*100 + k*50
      if X == comb:
        n_comb += 1
print(n_comb)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count=0
sum=0
for a in range(0, A+1):
    for b in range(0, B+1):
        for c in range(0, C+1):
            sum = 500*a + 100*b +50*c
            if X == sum:
                count+=1
            sum=0
print(count)

Submission status: Accepted

Solution code:
def solve(a, b, c, x):
    return sum(
        x == 500 * i + 100 * j + 50 * k
        for i in range(a + 1) # 500円
        for j in range(b + 1) # 100円
        for k in range(c + 1) # 50円
    )

_a = int(input())
_b = int(input())
_c = int(input())
_x = int(input())
print(solve(_a, _b, _c, _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):
            sum = 500 * i + 100 * j + 50 * k
            if sum == X:
                count += 1

print(count)

Submission status: Accepted

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

sum_pair = 0

for a in range(A + 1):
    for b in range(B + 1):
        c = (X - a * 500 - b * 100) / 50
        if c >= 0 and c <= C:
            sum_pair += 1

print(sum_pair)

Submission status: Accepted

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

X //= 50
answer = 0
for a in range(A + 1):
  if a * 10 > X:
    continue
  for b in range(B + 1):
    if a * 10 + b * 2 > X:
      continue
    for c in range(C + 1):
      if a * 10 + b * 2 + c == X:
        answer += 1

print(answer)

Submission status: Accepted

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

X //= 50
answer = 0
for a in range(A + 1):
  if a * 10 > X:
    continue
  for b in range(B + 1):
    for c in range(C + 1):
      if a * 10 + b * 2 + c == X:
        answer += 1

print(answer)

Submission status: Accepted

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

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

print(answer)

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

Submission status: Accepted

Solution code:
# 2020/01/29
# AtCoder Beginner Contest 087 - B

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

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

# Output
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):
		tmp = i*500 + j*100
		#print(tmp)
		k = (X-tmp) / 50
		if k>=0 and k <= C:
			count +=1
print(count)

Submission status: Accepted

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

print(L)

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=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())  # 500
B = int(input())  # 100
C = int(input())  # 50
X = int(input())  # 合計

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

Submission status: Accepted

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

ans = 0
for a in range(A + 1):  # 1からAまで　0は考慮しない
    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 _ in range(4)]

count = 0
for i in range(a, -1, -1):
    i_tmp = i * 500
    if i_tmp > x:
        continue
    for j in range(b, -1, -1):
        j_tmp = j * 100 + i_tmp
        if j_tmp > x:
            continue
        for k in range(c, -1, -1):
            sum = k * 50 + j_tmp
            if sum == x:
                count += 1

print(count)

Submission status: Accepted

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

count = 0
for i in range(a, -1, -1):
    i_tmp = i * 500
    for j in range(b, -1, -1):
        j_tmp = j * 100 + i_tmp
        for k in range(c, -1, -1):
            sum = k * 50 + j_tmp
            if sum == x:
                count += 1

print(count)

Submission status: Accepted

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

# 合計値
x = 0

# 組み合わせパターン
count = 0

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B, C, X = map(int, read().split())

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:
import numpy as np
import itertools
# coin tanka
tanka = np.array([500, 100, 50])
count = 0
A = int(input())
B = int(input())
C = int(input())
X = int(input())

# each pattern
a = [a for a in range(A+1)]
b = [b for b in range(B+1)]
c = [c for c in range(C+1)]

# all patterns
itr_res = np.array(list(itertools.product(a, b, c)))

# remove 0 0 0  pattern
itr_res = itr_res[1:]

for r in itr_res:
    # seach for X  with total price
    if X == sum(r * tanka):
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

y = []
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            y.append(500 * a + 100 * b + 50 * c)

print(y.count(X))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
x = [int(input()) for _ in range(4)]
ans = 0
for i in range(x[0]+1):   # 500の個数
    for j in range(x[1]+1): # 100の個数
        if x[3]-i*500-j*100 >=  0 and x[3]-i*500-j*100 <= x[2]*50:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
A,B,C,X=[int(input()) for i 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:
# -*- coding: utf-8 -*-

#整数値入力 1文字の入力
def input_one_number():
    return int(input())

#整数値龍力　複数の入力
def input_multiple_number():
    return map(int, input().split())

#整数値龍力　複数の入力(配列)
def input_multiple_number_as_list():
    return list(map(int, input().split()))

#2次元配列入力
def input_map():
    return [list(map(int,list(input()))) for i in range(h)]

#リスト出力
def print_list(list):
    print(*list)
    return

#2次元配列出力
def print_map(maplist):
    for i in maplist:print(*i, sep='')
    return

#素数生成
def generate_primenums():
    n = 100
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes.difference_update(range(i*2, n+1, i))
    primes=list(primes)
    return primes

def memo():
    a=[0]*5
    b=a  #良くない配列のコピー
    b2=a[:]  #1次元のときはコピーはこれで良い
    a[1]=3
    print('b:{}, b2:{}'.format(b,b2))  #b:[0, 3, 0, 0, 0], b2:[0, 0, 0, 0, 0]
    
    import copy
    a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
    b=copy.deepcopy(a)  #2次元配列はこうコピーする
    
    #内包表記奇数のみ
    odd=[i for i in range(100) if i%2==1] #[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]

    #二部探索
    import bisect
    a = [1, 2, 3, 5, 6, 7, 8, 9]
    b=bisect.bisect_left(a, 8)

    #combinations、組み合わせ、順列
    from itertools import permutations, combinations,combinations_with_replacement,product
    a=['a','b','C']
    print(list(permutations(a)))
    print(list(combinations(a,2)))
    print(list(combinations_with_replacement(a,3)))


#階乗
def kaijo(n):
    import math
    return math.factorial(n)

#選び方（コンビネーション nCr）
def num_combination(n,r):
    import math
    return math.factorial(n) // math.factorial(n - r)


#最大公約数、最小公倍数
def calc_gcd(a,b):
    import fractions
    GCD=fractions.gcd(a,b)
    lcm=a*b//gcd
    return gcd,lcm

#複数の最大公約数
def calc_gcd_list(l):
    import numpy as np
    return np.gcd.reduce(l)

A = input_one_number()
B = input_one_number()
C = input_one_number()
X = input_one_number()

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

print(cnt)

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

Solution code:
def getInput():
    return int(input())

_500 = getInput()
_100 = getInput()
_50  = getInput()
X = getInput()

cnt = 0
for A in range(_500 + 1):
    for B in range(_100 + 1):
        for C in range(_50 + 1):
            calc =  500*A + 100*B + 50*C
            if calc == X:
                cnt += 1

print(cnt)

Submission status: Accepted

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

count = 0
tmp = 0

for i in range(a,-1,-1) :
  tmp_500 = 500 * i
  if tmp_500 > x :
    continue

  for j in range(b,-1,-1) :
    tmp_100 = tmp_500 + j * 100
    if tmp_100 > x :
      continue

    for k in range(c,-1,-1) :
      tmp_50 = tmp_100 + k * 50
      #print(tmp_50)
      if tmp_50 > x :
        continue
      elif tmp_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 ai in range(a+1):
    a_val = 500 * ai
    for bi in range(b+1):
        b_val = 100 * bi
        for ci in range(c+1):
            c_val = 50 * ci
            sum_val = a_val + b_val + c_val
            if sum_val == x:
                count += 1

print(count)

Submission status: Accepted

Solution code:
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 i*500 + j*100 + k*50 == N:
                count += 1
                #print("{} = 500:{} 100:{} 50:{}".format(N, i, j, k))
                

print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            if 500*ai + 100*bi + 50 *ci ==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 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:
                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(0, a+1):
    for j in range(0, b+1):
        for k in range(0, 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 (i)*500+(j)*100+(k)*50 == X:
        count += 1
      else:
        pass
print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
k = 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 == k:
                #print(x,y,z)
                count += 1
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
# 整数の入力
A, B, C, X = int(input()), int(input()), int(input()), int(input())

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

Submission status: Accepted

Solution code:
#n = int(input())
#n, x  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
n = 4
m = [0]*n
counter = 0
for i in range(n):
  m[i] = int(input())

for i in range(m[0]+1):
  for ii in range(m[1]+1):
    for iii in range(m[2]+1):
      if (m[3] == i*500+ii*100+iii*50):
        counter = counter + 1
        
print(counter)

Submission status: Accepted

Solution code:
#n = int(input())
#n, x  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
n = 4
m = [0]*n
counter = 0
for i in range(n):
  m[i] = int(input())

for i in range(m[0]+1):
  mod = m[3] - 500*i
  if (mod < 0):
    continue
  for ii in range(m[1]+1):
    mod_2 = mod - 100*ii
    if (mod_2 < 0):
      continue
    if (mod_2 <= m[2]*50):
      counter = counter + 1

print(counter)

Submission status: Accepted

Solution code:
fiveh = int(input())
oneh = int(input())
fifty = int(input())
n = int(input())

cnt = 0
for i in range(fiveh+1):
  for s in range(oneh+1):
    for l in range(fifty+1):
      if (i*500)+(s*100)+(l*50) == n:
        cnt+=1

print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 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 += 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(a+1):
    for j in range(b+1):
        for s in range(c+1):
            if (i*500+j*100+s*50)==x:
                count+=1
print(count)

Submission status: Accepted

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

ans = 0

for a in range(0, A + 1):
    if a * 500 == X:
        ans += 1
        break

    if a * 500 > X:
        break

    x_a = X - a * 500
    for b in range(0, B + 1):
        if b * 100 == x_a:
            ans += 1
            break

        if b * 100 > x_a:
            break
        
        x_b = x_a - b * 100
        for c in range(0, C + 1):
            if c * 50 == x_b:
                ans += 1
                break

            if c * 50 > x_b:
                break

print(ans)

Submission status: Accepted

Solution code:

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

res = 0

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

print(res)

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())
print([500*_+100*i+50*j for _ in range(a+1) for i in range(b+1) for j in range(c+1)].count(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n_500,n_100,n_50=int(input()),int(input()),int(input())
price=int(input())
count=0
for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if price==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(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            if (i*500 + 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())
num=0
if a*500+b*100+c*50<x:
    print(0)
else:
    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:
                    num+=1
    print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
a2 = x // 500
if a <= a2:
  a2 = a
abcs = []
for i in range(int(a2) + 1):
  xi = x - 500*i
  b2 = xi // 100
  if b <= b2:
    b2 = b
  for j in range(int(b2)+1):
    xj = xi - 100*j
    k = int(xj / 50)
    if k <= c:
      abc = []
      abc.append(i)
      abc.append(j)
      abc.append(k)
      abcs.append(abc)
print(len(abcs))

Submission status: Accepted

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

n = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=0
i=0
j=0
while(i<=a and i*500<=x):
    while(j<=b and (i*500 + j*100) <=x):
        rest=x-i*500-j*100
        if(rest%50==0):
            k=rest//50
            if(0<=k and k<=c):
#                print(i,j,k)
                ans+=1
        j+=1
    i+=1
    j=0
print(ans)

Submission status: Accepted

Solution code:
import sys

if __name__ == "__main__":
    args = sys.stdin.read().split()
    count_of_500_coins, count_of_100_coins, count_of_50_coins, sum_of_price = tuple(map(int, args))

    cnt = 0
    for num_500_coins in range(0, count_of_500_coins + 1):
        remaining_price = sum_of_price - 500 * num_500_coins
        if remaining_price < 0:
            break

        for num_100_coins in range(0, count_of_100_coins + 1):
            remaining_price = sum_of_price - 500 * num_500_coins - 100 * num_100_coins
            if remaining_price < 0:
                break

            necessary_num_50_coins = remaining_price / 50
            if 0 <= necessary_num_50_coins <= count_of_50_coins:
                cnt += 1

    print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
"""AtCoder Beginner Contest 087: B - Coins
https://atcoder.jp/contests/abc086/tasks/abc087_b
"""

__author__ = 'bugttle <bugttle@gmail.com>'


def main():
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())

    result = 0
    for a_i in range(A+1):
        for b_i in range(B+1):
            for c_i in range(C+1):
                if a_i*500 + b_i*100 + c_i*50 == X:
                    result += 1

    print(result)


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

Solution code:
aa = int(input())
bb = int(input())
cc = int(input())
x = int(input())

count = 0

for a in range(aa+1):
    for b in range(bb+1):
        for c in range(cc+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(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):
            money = 500 * a + 100 * b + 50 * c
            if X == money:
                cnt += 1
print(cnt)

Submission status: Accepted

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

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


l = [500*a+100*b+50*c for a in range(A+1) for b in range(B+1) for c in range(C+1)]
print(l.count(X))

Submission status: Accepted

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

Submission status: Accepted

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

    for yen500 in range(A+1):
        for yen100 in range(B+1):
            for yen50 in range(C+1):
                total = 500 * yen500 + 100 * yen100 + 50 * yen50
                if X == total:
                    count += 1
                total = 0

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=int(input()) #500
b=int(input()) #100
c=int(input()) #50
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())

l1 = [500*i for i in range(0, a+1)]
l2 = [100*i for i in range(0, b+1)]
l3 = [50*i for i in range(0, c+1)]

count = 0
for i in l1:
   for j in l2:
      y = x - i - j
      if (y in l3):
         count += 1
print(count)

Submission status: Accepted

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

for na in range(a+1):
    for nb in range(b+1):
        for nc in range(c+1):
            if (500 * na + 100 * nb + 50 * nc) == x:
                count += 1

print(count)