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())
var = 0
for i in range(A+1):
  if (X-500*i) >= 0:
    Y = X-500*i
    for j in range(B+1):
      if ((Y-100*j) >= 0) and (((Y-100*j)//50) <= C):
        var = var+1
print(var)

Submission status: Accepted

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

A, B, C, X = int(input()), int(input()), int(input()), int(input())
counter = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
five_hnd = int(input())
one_hnd = int(input())
fifty = int(input())
target = int(input())
num = 0
for i in range(five_hnd + 1):
  for j in range(one_hnd + 1):
    for k in range(fifty + 1):
      sum = 500*i + 100*j + 50*k
      if (sum) == target :
        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 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 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:
#500円玉
A = int(input())
#100円玉
B = int(input())
#50円玉
C = int(input())
#合計金額
X = int(input())
total = 0
count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            total = a*500 + b*100 + c*50
            if(total == X):
                count = count + 1
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

c = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
count = 0


for coin_500_num in range(0,c+1):
    for coin_100_num in range(0,b+1):
        for coin_50_num in range(0,a+1):
            total = 500*coin_500_num + 100*coin_100_num + 50*coin_50_num
            if(total == x):
                count +=1


"""
自分の。
for 文のカウンタのスコープは有効だから、for文のifはいらなかった。

for coin_500_num in range(0,c+1):
    amari = x-500*coin_500_num
    if(amari == 0):
        count += 1
    elif(amari > 0):
        for coin_100_num in range(0,b+1):
            amari_2 = amari-100*coin_100_num
            if(amari_2 == 0):
                count += 1
            elif(amari_2 > 0):
                for coin_50_num in range(0,a+1):
                    amari_3 = amari_2-50*coin_50_num
                    if(amari_3 == 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):
  if i * 500 > X:
    break
  for j in range(B + 1):
    if i * 500 + j * 100 > X:
      break
    for k in range(C + 1):
      if i * 500 + j * 100 + k * 50 == X:
        ans += 1
        break
      if i * 500 + j * 100 + k * 50 > X:
        break
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):
      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):
      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())
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A = n()
B = n()
C = n()
X = n()

count = 0
for i in range(A+1):
    for j in range(B+1):
        rest = X - (500*i + 100*j)
        if rest >= 0 and rest // 50 <= C:
            count += 1
print(count)

Submission status: Accepted

Solution code:
def main():
    a, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))
    cnt = 0
    for i in range(min(a, x // 500) + 1):
        for j in range(min(b, (x - 500 * i) // 100) + 1):
            if c * 50 >= x - i * 500 - j * 100:
                cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n500 = int(input())
n100 = int(input())
n50 = int(input())
total = int(input())
count = 0
for i1 in range(n500+1):
    for i2 in range(n100+1):
        for i3 in range(n50+1):
            val100 = i2*100
            val500 = i1*500
            val50 = i3*50
            if val500+val100+val50 == total:
                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:
def abc():
    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)


abc()

Submission status: Accepted

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

a_list = [i for i in range(A+1)]
b_list = [i for i in range(B+1)]
c_list = [i for i in range(C+1)]

count = 0
for a in a_list:
    for b in b_list:
        for c in c_list:
            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())
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 i in range(A+1):
  for t in range(B+1):
    for z in range(C+1):
      if X == 500*i + 100*t + 50*z:
        count = 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(0,a+1):
    if 10*i > x/50:
            break
    for j in range(0,b+1):
        if 2*j > x/50:
            break
        for k in range(0,c+1):
            if k > x/50:
                break
            if 10*i+2*j+k == x/50:
                count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())  #合計金額

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

print(cnt)

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 (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())
total=[]
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      total.append(sum([500*a,100*b,50*c]))
ans = [i for i in total if i == X]
print(len(ans))

Submission status: Accepted

Solution code:

ans = 0
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
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())
p = 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:
        p = p + 1
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(A):
    for j in range(B):
        for k in range(C):
            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())
counti = 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:
        counti += 1

print(counti)

Submission status: Accepted

Solution code:
order = [int(input()) for i in range(4)]
A = order[0]
B = order[1]
C = order[2]
X = order[3]
count = 0

for l in range(A+1):
  for m in range(B+1):
    for n in range(C+1):
      if X == l * 500 + m * 100 + n * 50:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import itertools
A = range(int(input()) + 1)
B = range(int(input()) + 1)
C = range(int(input()) + 1)
X = int(input())

ptn = list(itertools.product(A, B, C))
cnt = 0
for i in ptn:
        if i[0] * 500 + i[1] * 100 + i[2] * 50 == 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())

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)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    a, b, c, x = [int(input()) for i in range(4)]
    
    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())
count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            s = a * 500 + b * 100 + c * 50
            # print(a, b, c, s)
            if s == X:
                count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(pattern)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())+1
b = int(input())+1
c = int(input())+1
n = int(input())

aa = (n // 500) + 1
bb = (n // 100) + 1
cc = (n // 50) + 1

cnt = 0

for i in range(0,min(aa,a)):
  for j in range(0,min(bb,b)):
    for k in range(0,min(cc,c)):
      if n == 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 i*500 + j*100 + k*50 == X:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

A, B, C, X = [int(sys.stdin.readline()) for _ in range(4)]
ans = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            ans += a*500+b*100+c*50 == X

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

print(count)

Submission status: Accepted

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

# 全部やる
answer = 0
for a in range(0,A+1):
  for b in range(0,B+1):
    for c in range(0,C+1):
      x = a*500 + b*100 + c*50
      if X == 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 k in range(c+1):
            if x == i*500+j*100+k*50:
                ans += 1

print(ans)

Submission status: Accepted

Solution code:
a, b, c, x = list(map(int, [input().rstrip() for _ in range(4)]))
ans = 0
for i in range(min(a, x // 500) + 1):
    for j in range(min(b, (x - i * 500) // 100) + 1):
        rest = x - (i * 500 + j * 100)
        if rest <= c * 50:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    # available only when mod is prime
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def main():
    a500 = intin()
    b100 = intin()
    c50 = intin()
    x = intin()

    ans = 0

    for i in range(a500 + 1):
        xx = x
        xx -= 500 * i
        if xx < 0:
            break
        for j in range(b100 + 1):
            xxx = xx
            xxx -= 100 * j
            if xxx < 0:
                break
            if xxx >= 0 and xxx % 50 == 0 and  xxx // 50 <= c50:
                ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


def solve(A: int, B: int, C: int, X: int):

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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re  # 正規表現, findall('正規表現', 文字列), search('正規表現', 文字列)
import sys # プログラム終了：sys.exit()
# sys.setrecursionlimit(10**6) # 再帰呼び出しの上限を上げる

def i_input(): return int(input())
def s_input(): return map(int,input().split())
def l_input(): return list(map(int, input().split()))
# 文字列のまま受け取りたいときはinput()

def check(x, a, b, c):
    diff = x - 500 * a - 100 * b
    if diff >= 0 and diff % 50 == 0 and diff // 50 <= c:
        return True
    else:
        return False

def main():
    a = i_input() # 500
    b = i_input() # 100
    c = i_input() # 50
    x = i_input() # sum

    count = 0
    for i in range(a + 1):
        for j in range(b + 1):
            if check(x, i, j, c):
                count += 1

    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
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 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 += 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()) #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())
count = 0
for i in range(a+1):
    sum = 500*i
    if sum == x:
        count += 1
    else:
        for j in range(b+1):
            sum_100 = 100*j
            if sum + sum_100 == x:
                count += 1
            else:
                for k in range(c+1):
                    sum_50 = 50*k
                    if sum + sum_100 + sum_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 == i * 500 + j * 100 + k * 50:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
int_list = [int(input()) for _ in range(4)]
res = 0
for n_500 in range(int_list[0] + 1):
  for n_100 in range(int_list[1] + 1):
    for n_50 in range(int_list[2] + 1):
      if n_500 * 500 + n_100 * 100 + n_50 * 50 == int_list[3]:
        res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    A, B, C, X = [int(input()) for x in range(4)]
    count = 0
    
    for A_coin in range(A + 1):
        
        for B_coin in range(B + 1):
            
            for C_coin in range(C + 1):
                
                if ((A_coin * 500) + (B_coin * 100) + (C_coin * 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())

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:
n500= int(input())
n100= int(input())
n50= int(input())
total = int(input())
#print(n500,n100,n50)
count500,count100,count50 =0,0,0
hit = 0
for i in range(0,n500+1):
  count500 =i
  for i in range(0,n100+1):
    count100 =i
    for i in range(0,n50+1):
      count50 =i
      if (count500*500 + count100*100 + count50* 50) == total:
        hit +=1
#print(count500,count100,count50)          
print(hit)

Submission status: Accepted

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

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 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())

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100 * j
        for k in range(min(c,Remains//50)+1):
            fifty = Remains - 50 * k
            if fifty == 0:
                count = count + 1
            else: continue

print(count)

Submission status: Accepted

Solution code:
z = [int(input()) for i in range(4)]
count = 0

for i in range(z[0]+1):
  for j in range(z[1]+1):
    for k in range(z[2]+1):
      if 500*i + 100*j + 50*k == z[3]:
        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 == (i*500 + j*100 + k*50):
                ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    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 + 50*c == 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())
x = int(x / 50)
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        left = x - i * 10
        left -= j * 2
        if 0 <= left and  left <= c:
            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(0,500*a+1,500):
    for j in range(0,100*b+1,100):
        if (x-i-j)%50 == 0 and x-i-j >= 0 and (x-i-j)//50 <= c:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for c500 in range(a+1):
  for c100 in range(b+1):
    for c50 in range(c+1):
      if 500*c500 + 100*c100 + 50*c50 ==x:
        case=case+1
print(case)