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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 初期入力
import sys
input = sys.stdin.readline
A500 = int(input())
B100 = int(input())
C50 = int(input())
X = int(input())

ans =0
num_500 =0
#500円を最大何枚使えるか
if 1 <= X //500 <=A500: 
    num_500 =X//500
elif X //500 <1:
    num_500 =0
else:
    num_500 =A500

#100円を最大何枚使えるか
num_100_list =[0]
num_100 =0
if num_500 !=0:
    for i in range(num_500+1):
        if 1 <= (X -500*i) /100 <=B100:
            num_100_list.append( (X -500*i) //100 )
        elif (X -500*i) /100 <1:
            num_100_list.append(0)
        else:
            num_100_list.append(B100)
else:
    if 1 <= X //100 <=B100: 
        num_100 =X//100
    elif X //100 <1:
        num_100 =0
    else:
        num_100 =B100
num_100 =max(max(num_100_list),num_100)

num_50 =0
#if num_500 * num_100 !=0:
for i in range(num_500 +1):
    for j in range(num_100 +1):
        if 0 <=(X -500*i -100 *j) /50 <=C50:
            #print(i,j)
            ans +=1

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
def I(): return int(stdin.readline().rstrip())
    
coin = [I() for _ in range(3)]
x = I()
ans = 0
for i in range(coin[0]+1):
    sum = 500*i
    if sum<=x:
        for j in range(coin[1]+1):
            tmp = sum + 100*j
            if tmp<=x:
                for k in range(coin[2]+1):
                    if tmp+50*k==x:
                        ans += 1
                        break
                    elif x<tmp+50*k:
                        break
            else:
                break
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
x=int(input())
ans=0
L=[500*a+100*b+50*c for c in range(C+1) for b in range(B+1) for a in range(A+1)]
print(L.count(x))

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
m=int(input())//50
ans=0
for x in range(1+min(a,m//10)):
  n=m-10*x
  for y in range(1+n//2):
    z=n-2*y
    if y<=b and z<=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(0,A+1):
	for j in range(0,B+1):
		for k in range(0,C+1):
			#print(500*i + 100*j + 50*k)
			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())
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

count = 0
for i in range(a + 1):
    p = 500 * i
    for j in range(b + 1):
        q = 100 * j
        for k in range(c + 1):
            r = 50 * k
            if p + q + r == x:
                count += 1
                
print(count)

Submission status: Accepted

Solution code:
def main():
    n = 4
    a = [int(input()) for i in range(n)]
    A = a[0]
    B = a[1]
    C = a[2]
    X = a[3]
    result = 0
    for i in range(A+1):
        for j in range(B+1):
            for k in range(C+1):
                value = 500 * i + 100 * j + 50 * k
                if value == 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 x == i*500+j*100+k*50:
                ans+=1
print(ans)

Submission status: Accepted

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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a, b, c, x = [ii() for _ 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)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

num = 0
total = 0

for i in range(a+1):
    for m in range(b+1):
        for p in range(c+1):
            total = 500*i + 100*m + 50*p
            if(X == total):
                num += 1

print(num)

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
            else:
                pass
print(count)

Submission status: Accepted

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

def multiple(l,m,n):
    ans = 500*l + 100*m + 50*n
    return ans
o = 0
p = 0
q = 0

while o <= a:
    while p <= b:
        while q <= c:
            ans_x = multiple(o,p,q)
            if x == ans_x:
                count += 1
            q += 1
        q = 0
        p += 1
    q = 0
    p = 0
    o += 1

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

l = int(input())
m = int(input())
n = int(input())
x = int(input())

count = 0
for i in range(l + 1):
    p = 500 * i
    for j in range(m + 1):
        q = 100 * j
        for k in range(n + 1):
            r = 50 * k
            if p + q + 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):
            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())
total = 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:
        total = total + 1
print(total)

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

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:
# -*- coding: utf-8 -*-

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

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

## Logic

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

print(ans)

Submission status: Accepted

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

count=0
a_max=min(x//500,a) #500玉の最大数
for i in range(a_max+1):#ループ数は+1　(0~max枚)
  # print("i:500円玉",i)
  b_max=min((x-500*i)//100,b) #全体から500円玉の値段を引いた、残りの100玉の枚数を考える
  # print("100円玉最大数",b_max)
  for j in range(b_max+1):
    # print("i,j",i,j)
    if (x-500*i-100*j)//50<=c:
      count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

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
            else:
                pass

print(count)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  for b in range(B+1):
    y = 500*a + 100*b
    c = (X - y)//50
    if 0 <= c <= C:
      ans += 1

print(ans)

Submission status: Accepted

Solution code:
A, B, C, X = map(int, open(0))
ans = 0
for i in range(A + 1):
    for j in range(B + 1):
        if 500 * i + 100 * j > X:
            break
        rem = X - 500 * i - 100 * j
        if rem // 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 i in range(A + 1):
    for j in range(B + 1):
        if 500 * i + 100 * j > X:
            break
        rem = X - 500 * i - 100 * j
        if rem // 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(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            y = 500 * i + 100 * j + 50 * k
            if y == x:
                cnt += 1
                
print(cnt)

Submission status: Accepted

Solution code:
#A500, B100, C50, X
a, b, c = int(input())+1, int(input())+1, int(input())+1 
X = int(input())

#possible comb
import itertools 
coins_a, coins_b, coins_c = [], [], []
for i in range(a):
  coins_a.append(500*i)
for i in range(b):
  coins_b.append(100*i)
for i in range(c):
  coins_c.append(50*i)
coins = list(itertools.product(coins_a, coins_b, coins_c))

#assessment 
ttl = list(map(sum, coins))
result = []
for n in ttl:
  if n == X: result.append(1)
  else: result.append(0)

print(sum(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 l in range(c + 1):
            total = i * 500 + j * 100 + 50 * l
            if(total == x):
                count += 1

print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

# 500, 100, 50

x = int(input())

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

print(solve())

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

ans = 0

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

Submission status: Accepted

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

answer = sum(500*a+100*b+50*c == X for b in range(B+1) for c in range(C+1) for a in range(A+1))
print(answer)

Submission status: Accepted

Solution code:
n500 = int(input())
n100 = int(input())
n50 = int(input())
p = int(input())
ans = 0

for i in range(n500+1):
    for j in range(n100+1):
        for k in range(n50+1):
            temp = i*500+j*100+k*50 
            if temp == p:
                ans+=1

print(ans)

Submission status: Accepted

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

answer = 0

for i in range(a + 1):
    y = x - 500 * i
    for j in range(b + 1):
        z = y - 100 * j
        if z >= 0 and z / 50 <= c:
            answer += 1
        
print(answer)

Submission status: Accepted

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

i=0
#j=0 ここに入れるとだめ
ans=0
while i <=A:
    X_aftera=X-500*i
    if X_aftera<0:
        break
    j=0
    while j<=B:
        X_afterb=X_aftera-100*j
        if X_afterb<0:
            break
        if X_afterb//50<=C:
            ans +=1
        j+=1
    i+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
#500a + 100b + 50c = 50m = X
m = X / 50
count = 0
for a in range(A+1):
    z = m - 10*a
    if z < 0:
        break
    else:
        for b in range(B+1):
            y = z - 2*b
            if y >= 0 and C >= y :
                count += 1
            elif y < 0:
                break
print(count)

Submission status: Accepted

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

ans = 0

for x in range(A+1):
    for y in range(B+1):
        for z in range(C+1):
            if 500 * x + 100 * y + 50 * z == X:
                ans +=1

print(ans)

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
l = [500, 100, 50]
ans = 0
for i in range(a+1):
    for j in range(b+1):
        s = 500*i + 100*j
        if (x-s)%50==0 and (x-s) >= 0 and (x-s)<= 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(A+1):
  for j in range(B+1):
    s=i*500+j*100
    if (X-s)%50==0 and (X-s)/50<=C and (X-s)/50>=0:
      cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Coins
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=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):
        if x >= i*500 + j*100 and x <= i*500 + j*100 + c*50:
            count += 1
print(count)

Submission status: Accepted

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
_x = int(input())
answer = 0
for c in range(c50+1):
    for b in range( b100+1):
        for a in range(a500+1):
            #print (a,b,c)
            if a*500 + b*100 + c*50 == _x:
                answer += 1
print (answer)

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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

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

print(pair_num)

Submission status: Accepted

Solution code:
a=[]
for i in range(3):
    a.append(int(input()))
x=int(input())
ans=0

for i in range(a[0]+1):
    for j in range(a[1]+1):
        for k in range(a[2]+1):
            if i*500+j*100+k*50==x:
                ans+=1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)

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

xx = x/50
count=0

for na in range(a+1):
    for nb in range(b+1):
        for nc in range(c+1):
            if na*10 + nb*2 + nc == xx:
                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())

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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(sum(500*a+100*b+50*c == 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())
r = []

for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      r.append(500*i + 100*j + 50*k)

print(r.count(x))

Submission status: Accepted

Solution code:
a_l = list(range(0,int(input())+1))
b_l = list(range(0,int(input())+1))
c_l = list(range(0,int(input())+1))
X = int(input())

count = 0
for a in a_l :
    for b in b_l :
        for c in c_l :
            N = 500 * a + 100 * b + 50 * c
            if N == X :
                count = count + 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

for ai in range(a+1):
    x1 = x - 500*ai
    
    if x1 == 0:
        n += 1
        break
        
    for bi in range(b+1):
        x2 = x1 - 100*bi
        
        if x2 == 0:
            n += 1
            break
        
        for ci in range(c+1):
            x3 = x2 - 50*ci
            
            if x3 == 0:
                n += 1
                break
            

print(n)

Submission status: Accepted

Solution code:
a, b, c = [int(input()) for _ in range(3)]
x = int(input())
count = 0
sum = 0

for i in range(a+1):
    if x < 500*i:
        break
    for j in range(b+1):
        if x < 100*j + 500*i:
            break
        for l in range(c+1):
            sum = i*500 + j*100 + l*50
            if sum == x:
                count = count+1

print(count)

Submission status: Accepted

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

ll = []

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            ll.append(10*i+2*j+k)
ans = 0
for s in ll:
    if s == x//50:
        ans += 1
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
# For taking integer inputs.
def inp():
    return(int(input()))


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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B, C, X = map(int, readlines())
count = 0

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

print(count)

Submission status: Accepted

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

print(count)