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):
  if 500 * i > X:
    break
  for j in range(B + 1):
    if 500 * i + 100 * j > X:
      break
    if X - 500 * i - 100 * j <= 50 * C:
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    x2 = x // 50
    count = 0
    # 10a + 2b + c = x2

    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if 10 * i + 2 * j + k == x2:
                    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())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力

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

i = 0
j = 0
k = 0
cnt = 0
sum = 0
while i <= A:
    j = 0
    if i>50:
        break
    while j <= B:
        k = 0
        if j>50:
            break
        while k <= C:
            if k>50:
                break
            else:
                sum = 500*i + 100*j + 50*k
                if X == sum:
                    cnt += 1
                k += 1
                sum = 0
        j += 1
    i += 1

print(cnt)

Submission status: Accepted

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

ra = min(A,int(Y//500+1))
rb = min(B,int(Y//100+1))
rc = min(C,int(Y//50+1))
#print(ra,rb,rc)

cnt = 0
for a in range(0,ra+1):
  for b in range(0,rb+1):
    for c in range(0,rc+1):
      if 500*a + 100*b + 50*c == Y:
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    ans = 0

    for n in range(a + 1):
        for m in range(b + 1):
            for l in range(c + 1):
                if (500 * n + 100 * m + 50 * l) == x:
                    ans = ans + 1

    print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

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

count = 0

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

print(count)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

Submission status: Accepted

Solution code:
a,b,c,x=[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())

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)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

cnt = 0

for i in range(a + 1):
  for j in range(b + 1):
    for k in range(c + 1):
      s = int(i*10 + j*2 + k)
      if s == x:
        cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

import string

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



if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
# a, b, c, x = map(int, open(0))

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

counter = 0

for ai in range(A + 1):
    for bi in range(B + 1):
        for ci in range(C + 1):
            if X == ai * 500 + bi * 100 + ci * 50:

                counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Coins
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:
s = [int(input()) for i in range(4)]
x=0
a=0
b=0
c=0
for i in range(s[0]+1):
    for i in range(s[1]+1):
        for i in range(s[2]+1):
            if 500*a+100*b+50*c == s[3]:
                x=x+1
            c=c+1
        b=b+1
        c=0
    a=a+1
    b=0
    c=0
print(x)

Submission status: Accepted

Solution code:
#!/user/bin/env pypy3
import collections
import sys


def fast_input():
    return sys.stdin.readline()[:-1]


def solve(c_500: int, c_100: int, c_50: int, amount: int) -> int:
    amount_list = []
    for i_500 in range(c_500 + 1):
        for i_100 in range(c_100 + 1):
            for i_50 in range(c_50 + 1):
                amount_list.append(i_500 * 500 + i_100 * 100 + i_50 * 50)

    return amount_list.count(amount)


def main():
    c_500 = int(fast_input())
    c_100 = int(fast_input())
    c_50 = int(fast_input())
    amount = int(fast_input())
    result = solve(c_500, c_100, c_50, amount)
    print(result)


main()

Submission status: Accepted

Solution code:
#!/user/bin/env pypy3
import sys


def fast_input():
    return sys.stdin.readline()[:-1]


def solve(c_500: int, c_100: int, c_50: int, amount: int) -> int:
    combination_count = 0
    for i_500 in range(c_500 + 1):
        for i_100 in range(c_100 + 1):
            for i_50 in range(c_50 + 1):
                total_amount = i_500 * 500 + i_100 * 100 + i_50 * 50
                if total_amount == amount:
                    combination_count += 1
    return combination_count


def main():
    c_500 = int(fast_input())
    c_100 = int(fast_input())
    c_50 = int(fast_input())
    amount = int(fast_input())
    result = solve(c_500, c_100, c_50, amount)
    print(result)


main()

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

for p in range(a+1):
   if 500*p > x:
      break
   for q in range(b+1):
      if 500*p + 100*q > x:
         break
      for r in range(c+1):
         if 500*p + 100*q + 50*r > x:
            break
         if 500*p + 100*q + 50*r == x:
            y += 1

print(y)

Submission status: Accepted

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

print(counts)

Submission status: Accepted

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

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

counter = 0
s = 0

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

print(counter)

Submission status: Accepted

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

if A > 40:
	Amax = 40
else:
	Amax = A

ans = 0
for i in range(Amax+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())
s=[]
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            s.append(500*i+100*j+50*k)
print(s.count(x))

Submission status: Accepted

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

answer = 0
for coin1 in range(a+1):
    for coin2 in range(b+1):
        for coin3 in range(c+1):
            if x == 500 * coin1 + 100 * coin2 + 50 * coin3:
                answer += 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[a,b,c,d]=[int(input()) for i in range(1,4+1)]
a1 = d // 500
b1 = d// 100
c1 = d// 50
coun = 0
for i in range(0,min([a+1,a1+1])):
    a = 500*i
    if a == d:
        coun = coun +1
        break
    for j in range(0,min([b+1,b1+1-5*i])):
        s = a + 100*j
        if s == d :
            coun = coun +1
            break
        for k in range(0,min([c+1,c1+1-10*i-2*j])):
            v = s + 50*k
            if v == d :
                coun = coun+1
                break
print(coun)

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 i*10+j*2+k==x:
                ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    print(ans)


if __name__ == '__main__':
    main()

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):
            total = 500*i + 100*j + 50*k
            if total == x:
                cnt += 1 
print(cnt)

Submission status: Accepted

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

ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 10*a + 2*b + c == X:
        ans += 1
print(ans)

Submission status: Accepted

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

s = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        cc = x - i * 500 - j * 100

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

Submission status: Accepted

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

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


def binary_search(x, c_nums):
    l = 0
    r = c
    while l + 1 != r and c != 0:
        m = (l + r) // 2
        if c_nums[m] == x:
            return 1
        elif c_nums[m] < x:
            l = m
        elif c_nums[m] > x:
            r = m
        m = (l + r) // 2
    if x == c_nums[l] or x == c_nums[r]:
        return 1
    else:
        return 0


c_nums = [50 * i for i in range(c + 1)]
res = 0
for i in range(a + 1):
    for j in range(b + 1):
        tmp = x - 500 * i - 100 * j
        res += binary_search(tmp, c_nums)

print(res)

Submission status: Accepted

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

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

print(res)

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())
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()), int(input()), int(input()), 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())

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

print(cn)

Submission status: Accepted

Solution code:
a,b,c,x = map(int,open(0).read().split())

ans = 0 
counta = 0

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

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 i in range(a+1):
    gh = 500*i
    for j in range(b+1):
        hy = 100*j
        for k in range(c+1):
            gj = 50*k
            t = gh + hy + gj
            if t == x:
                ans += 1

print(ans)

Submission status: Accepted

Solution code:
# 2020-08-30, Sun

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c, x = map(int, open(0).read().split())
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())
res=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            tmp=i*500+j*100+k*50
            if tmp==x:
                res+=1
print(res)

Submission status: Accepted

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

counter = 0
for use_a in range(a + 1):
    if 500 * use_a > x:
        continue
    rest = x - 500 * use_a
    for use_b in range(b + 1):
        if 100 * use_b > rest:
            continue
        rest_c = rest - 100 * use_b
        for use_c in range(c + 1):
            if 50 * use_c != rest_c:
                continue
            counter += 1

print(counter)

Submission status: Accepted

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

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            tmp = 500*i+100*j+50*k
            if tmp==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:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(A, B, C, X))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    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 = 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 i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


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):
                if i * 500 + j * 100 + k * 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())
c=0
for i in range(0,A+1):
  Y=X-i*500
  for j in range(0,B+1):
    Y=Y-j*100
    for l in range(0,C+1):
      Y=Y-l*50
      if Y == 0:
        c += 1
        Y=Y+l*50
      else :
        Y = Y + l*50
    else :
      Y = Y+j*100
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:
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+50*k==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())

count = 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 x == t:
        count = count + 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

total=0
cnt=0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            total=i*500 + j*100 + k*50
            if total == 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())

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:
num_500 = int(input())
num_100 = int(input())
num_50 = int(input())
ans = int(input())

resultCnt = 0

for i in range(num_500+1):
  for j in range(num_100+1):
    for k in range(num_50+1):
      if 500*i + 100*j + 50*k == ans:
        resultCnt += 1

print(resultCnt)

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):
      num_500=500*i
      num_100=100*j
      num_50=50*k
      if num_500+num_100+num_50==x:
        ans+=1
        
print(ans)

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for s in range(a+1):
    if s*500 == x:
        count += 1
    for t in range(b+1):
        if s*500 + t*100 == x and t != 0:
            count += 1
        for u in range(c+1):
            if s*500 + t*100 + u*50 == x and u != 0:
                count += 1

print(count)

Submission status: Accepted

Solution code:
# 087 B
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 X == (500*i + 100*j + 50*k):
                n += 1
print(n)

Submission status: Accepted

Solution code:
a=int(input(""))
b=int(input(""))
c=int(input(""))
x=int(input(""))
def countcourse(r,t,y,u):
    cnt=0
    n=0
    for h in range(r+1):
        for l in range(t+1):
            for o in range(y+1):
                if 500*h+100*l+50*o==u:
                    cnt+=1
    return cnt
print(countcourse(a,b,c,x))

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

Submission status: Accepted

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

pattern=0

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

Submission status: Accepted

Solution code:
a=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):
      A=500*i+100*j+50*k
      if A==X:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
c=0
y,z,d=int(input()),int(input()),int(input())
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            f=500*i+100*j+50*k
            if(f==d):
                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):
            money = 500*i+100*j+50*k
            if money == X:
                cnt += 1

print(cnt)