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

print([500*i+100*j+50*k for k in range(c+1) for j in range(b+1) for i in range(a+1)].count(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
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 = (x-500*i-100*j)/50
        if tmp <= c and tmp >= 0 and tmp - math.floor(tmp) == 0 :
            count += 1

print(count)

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

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

for coin500 in range(a+1):
    for coin100 in range(b+1):
        for coin50 in range(c+1):
            if coin500 * 500 + coin100 * 100 + coin50 * 50 == x:
                ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input_num = [int(input()) for i in range(4)]

coin_list = input_num[0:3]
result_yen = input_num[3]

count = 0

for yen_500 in range(coin_list[0]+1):
    for yen_100 in range(coin_list[1]+1):
        for yen_50 in range(coin_list[2]+1):
            if result_yen == yen_500*500 + yen_100*100 + yen_50 *50:
                count += 1
                
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=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:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

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


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

print(total)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin

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

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

for i in range(a+1):
    for ii in range(b+1):
        for iii in range(c+1):
            if (i*500 + ii*100 + iii*50) == x:
                inc +=1

print(inc)

Submission status: Accepted

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


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


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:
import itertools
A = int(input())
B = int(input())
C = int(input())
X = int(input())
AL = [500*i for i in range(A+1)]
BL = [100*i for i in range(B+1)]
CL = [50*i for i in range(C+1)]
num = 0

for comb in itertools.product(AL,BL,CL):
  x,y,z = comb
  if x + y + z == X:
    num += 1
print(num)

Submission status: Accepted

Solution code:



def main():
    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):
                now_mony = 500 * i + 100 * j + 50 * k
                if now_mony > x:
                    break
                if now_mony == x:
                    ans += 1
    print(ans)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
yen_500 = int(input())
yen_100 = int(input())
yen_50 = int(input())
yen_x = int(input())
done_cnt = 0
for i in range(yen_500 + 1):
    for j in range(yen_100 + 1):
        for k in range(yen_50 + 1):
            if yen_x == 500 * (i) + 100 * (j) + 50 * (k):
                done_cnt += 1 
print(done_cnt)

Submission status: Accepted

Solution code:
def culc_sum(i_a,i_b,i_c):
    return (500 * i_a + 100 * i_b + 50 * i_c)


a_n = int(input())
b_n = int(input())
c_n = int(input())

X = int(input())

result = 0

for i_a in range(a_n + 1):
  if (500 * i_a) > X:
    break
  for i_b in range(b_n + 1):
    if (500 * i_a + 100 * i_b) > X:
      break
    for i_c in range(c_n + 1):
      #print(500 * i_a + 100 * i_b + 50 * i_c)
      if culc_sum(i_a,i_b,i_c) == X:
        result = result + 1
        break

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

Submission status: Accepted

Solution code:
A, B, C, X = [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 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())

n=0

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

print(n)

Submission status: Accepted

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

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

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:
c_500 = int(input())
c_100 = int(input())
c_050 = int(input())
x = int(input())

ans = 0
for u_500 in range(0, c_500+1):
    for u_100 in range(0, c_100+1):
        for u_050 in range(0, c_050+1):
            if (u_500 * 500 + u_100 * 100 + u_050 * 50) == x:
                ans += 1

print(ans)

Submission status: Accepted

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


cnt = 0
sumc = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            sumc = 500*i + 100*j + 50 *k
            if sumc == X:
                cnt = 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 (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())
l=[]
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      l.append([i,j,k])
c=0
for item in l:
  v=item[0]*500+item[1]*100+item[2]*50
  if v==x:
    c+=1
print(c)

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:
#define
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0
countlist=[]
#sorting
for e in range(0,a+1):
    if e*500 <= x:
        y=x-e*500
        for f in range(0,b+1):
            if f*100 <= y:
                z=y-100*f
                for g in range(0,c+1):
                    if g*50 == z :                                            
                        count = count +1

print(count)

Submission status: Accepted

Solution code:
a,b,c,d = list(int(input()) for i in range(4))
ans = 0
for i in range(a + 1):
    for o in range(b + 1):
        for p in range(c + 1):
            if 500 * i + 100 * o + 50 * p == d:
                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):
            if (i*500 + j * 100 + k*50) == x:
                res += 1
print(res)

Submission status: Accepted

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

cnt = 0
for i in reversed(range(A + 1)):
	for j in range(B + 1):
		sum = X - (500 * i) - (100 * j)
		if sum < 0:
			break
		if sum // 50 <= C:
			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 (i*500+j*100+k*50) == X:
                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 nA in range(A+1):
    for nB in range(B+1):
        for nC in range(C+1):
            if nA*500 + nB*100 + nC*50 == X:
                ans += 1

print(ans)

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

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 v in range(C+1):
            if 500*i + 100*j + 50*v == 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 = count + 1
print(count)

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

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 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:
num500 = int(input())
num100 = int(input())
num50 = int(input())
numSum = int(input())

patternCounter = 0

for count500 in range(num500 +1):
    if numSum < count500 * 500:
        break
    for count100 in range(num100 + 1 ):
        if numSum < ((count500 * 500) + (count100 * 100)):
            break
        for count50 in range(num50 + 1):
            if numSum < ((count500 * 500) + (count100 * 100) + (count50 * 50)):
                break
            elif numSum == ((count500 * 500) + (count100 * 100) + (count50 * 50)):
                patternCounter +=1

print(patternCounter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = int(input())

count = 0

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

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

print(cnt)

Submission status: Accepted

Solution code:
a = int(input()) # 500
b = int(input()) # 100
c = int(input()) # 50
x = int(input()) # 50 - 20000
ans = 0
for i in range(a+1):
    current = x - 500*i
    if current < 0:
        break
    elif current == 0:
        ans += 1
        break
    for j in range(b+1):
        current2 = current - 100*j
        if current2 < 0:
            break
        elif current2 == 0:
            ans += 1
            break
        for k in range(c+1):
            current3 = current2 - 50*k
            if current3 < 0:
                break
            elif current3 == 0:
                ans += 1
                break

print(ans)

Submission status: Accepted

Solution code:
yen500 = int(input())
yen100 = int(input())
yen50 = int(input())
sum = int(input())
count = 0

for i in range(yen500 + 1):
  for j in range(yen100 + 1):
    for k in range(yen50 + 1):
      if (500 * i + 100 * j + 50 * k) == sum:
        count += 1
        
print(count)

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

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):
    if 500*i < X:
        AA = 500*i
        for j in range(B+1):
            if 100*j < X-AA:
                BB = 100*j
                for k in range(C+1):
                    if 50*k == X-AA-BB:
                        a +=1
                    else:
                        pass
            elif 100*j == X-AA:
                a += 1
            else:
                pass
    elif 500*i == X:
        a +=1       
print(a)

Submission status: Accepted

Solution code:
import itertools

if __name__ == '__main__':
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    # print(A)
    # A, B, C, X = 30, 40, 50, 6000

    A_list = list(map(lambda x: x * 500, range(A + 1)))
    B_list = list(map(lambda x: x * 100, range(B + 1)))
    C_list = list(map(lambda x: x * 50, range(C + 1)))

    all_list = list(itertools.product(A_list, B_list, C_list))
    sum_list = list(map(lambda t: sum(t), all_list))
    print(sum_list.count(X))

Submission status: Accepted

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

    counter = 0

    for Ai in range(A + 1):
        for Bi in range(B + 1):
            for Ci in range(C + 1):
                total = 500*Ai + 100*Bi + 50*Ci
                if total == X:
                    counter += 1

    print(counter)

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 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)]
x//=50
p=min(a,x//10)
ans=0
for i in range(p+1):
    y=x-10*i
    q=min(b,y//2)
    for j in range(q+1):
        z=y-2*j
        if c>=z:ans+=1
print(ans)

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

a, b, c = [500, 100, 50]
count = 0

for _A in range(A+1):
  if (_A*a > X):
    break
  for _B in range(B+1):
    d = X - _A*a - _B*b
    if (d/c <= C and d>=0):
      count = count + 1

print("{}".format(count))

Submission status: Accepted

Solution code:
#l = list(map(int, input().split(' ')))

#num = int(input())
#S = str(input())
# k = (X - Ai - Bj) / C
# C = 0
#
A=int(input())
B=int(input())
C=int(input())
X=int(input())
sum = 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):
                sum+=1

print(sum)

Submission status: Accepted

Solution code:
#l = list(map(int, input().split(' ')))

#num = int(input())
#S = str(input())
# k = (X - Ai - Bj) / C
# C = 0
#
A=int(input())
B=int(input())
C=int(input())
X=int(input())
sum = 0

for i in range(0,A+1):
    for j in range(0,B+1):
        # Cが固定のパターン
        if C == 0:
            if i*500 + j*100 == X:
                sum+=1
                break
        # Cが不定のパターン
        else:
            k = ( X - i*500 - j*100 ) / 50
            #print (k)
            if k < 0:
                break
            if k<=C:
                sum+=1
        # for k in range(0,C+1):
        #     if(500*i+100*j+50*k==X):

print(sum)

Submission status: Accepted

Solution code:
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
X = int(input())

answer = 0

for i in range(coin500 + 1):
    for j in range(coin100 + 1):
        for k in range(coin50 + 1):
            if 500 * i + 100 * j + 50 * k == X:
                answer += 1

print(answer)

Submission status: Accepted

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

count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            res = 500 * i + 100 * j + 50 * k
            if(res == cond):
                count = count + 1
print(count)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a,b,c,x = [int(input()) for i in range(4)]
ans = 0
for i in range(a+1):
    for j in range(b+1):
        if 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())

counter = 0

N_maxA = min( int(X // 500), A )

for i in range(N_maxA + 1):
	Res = X - (i * 500)
	N_maxB = min( int(Res // 100) , B )
	
	for j in range(N_maxB + 1):
		Res1 = Res - j*100
		if int(Res1 // 50) <= C:
			
			counter += 1

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

print(cnt)

Submission status: Accepted

Solution code:
gohyaku = int(input())
hyaku = int(input())
gozyuu = int(input())
x = int(input())

count = 0
for i in range(gohyaku+1):
    for j in range(hyaku+1):
        for k in range(gozyuu+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())
cnt = 0
for i in range(b + 1):
    for j in range(c + 1):
        a500 = (x//50 - 2 * i - j) /10
        if 0 <= a500 <=a and a500.is_integer():
            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+50*k==x:
                                ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C,X = [int(input()) for i in range(4)]
n,a=0,0
while a<A+1:
  b=0
  while b<B+1:
    x=a*500+b*100
    b+=1
    if X<x:continue
    if (X-x)<=C*50:n+=1
  a+=1
print(n)

Submission status: Accepted

Solution code:
# inputの割り当て
A = int(input()) #５００円の枚数
B = int(input()) #1００円の枚数
C = int(input()) #5０円の枚数
X = int(input()) #合計金額

# 変数準備
i = 0
ans = 0

# for文
for i in range(A+1):
	j = 0
	for j in range(B+1):
		k = 0
		for k in range(C+1):
			sum = 500*i + 100*j + 50*k
			if sum - X == 0:
				ans += 1
		k += 1
	j += 1
i += 1

# 結果の表示
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
#x=X
n=0
for a in range(A+1):
    X1=X-500*a #
    for b in range(B+1):
        X2=X1-100*b
        for c in range(C+1):
            X3=X2-50*c
            if X3==0:
                n+=1
print(n)

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

bb = b
cc = c

cnt = 0
 
while a > -1:
    b = bb
    while b > -1:
        c = cc
        while c > -1:
            if (500 * a + 100 * b + 50 * c) == x:
                cnt += 1
            c -= 1
        b -= 1
    a -= 1

print(cnt)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
x=X//50
r=[]
for i in range(A+1):
    for k in range(B+1):
        for h in range(C+1):
            if i*500+k*100+h*50==X:
                r.append([i,k,h])
print(len(r))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 0
for i in range(a+1):
  if i * 500 > d:
    break
  for ii in range(b+1):
    if i * 500 + ii * 100 <= d:
      if (d - (i * 500 + ii * 100)) // 50 <= c:
        res+=1

print(res)

Submission status: Accepted

Solution code:
data=[0]*4
pt=[]
for i in range(4):
  data[i]=int(input())

cnt = 0
for i in range(data[2]+1):
    res = data[3]
    for j in range(data[1]+1):
        for k in range(data[0]+1):
            res=50*i+100*j+500*k
            if res==data[3]:
                cnt+=1
                pt.append([i,j,k])
                continue
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 500 * a + 100 * b + 50 * c == X:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
def ipt(N=0,switch=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        if switch==0:
            return [list(map(int,input().split())) for _ in range(N)]
        else:
            return [int(input()) for _ in range(N)]

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

print(cnt)

Submission status: Accepted

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

for a_num in range(a+1):
    for b_num in range(b+1):
        for c_num in range(c+1):
            if a_num * 500 + b_num * 100 + c_num * 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 A_num in range(A+1):
    for B_num in range(B+1):
        for C_num in range(C+1):
            if A_num * 500 + B_num * 100 + C_num * 50 == X:
                count += 1
print(count)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B, C, X = [int(stdin.readline().rstrip()) 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 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())

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

print(num_x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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