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:
a5 = int(input())
b1 = int(input())
c5 = int(input())
x = int(input())
count = 0
for i in range(a5+1):
    for j in range(b1+1):
        for k in range(c5+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())

LI = []
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
            LI.append(y)

counter = 0
for l in range(len((LI))):
    if LI[l] == x:
        counter += 1
    
print(counter)

Submission status: Accepted

Solution code:
A = int(input()) # 500円玉の枚数
B = int(input()) # 100円玉の枚数
C = int(input()) #  50円玉の枚数
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:
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 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 a_num in range(A+1):
    for b_num in range(B+1):
        for c_num in range(C+1):
            price = 500*a_num+100*b_num+50*c_num
            if price == X:
                count += 1
print(count)

Submission status: Accepted

Solution code:
l=[int(input()) for i in range(3)]
x=int(input())
ans=0
count=0
for i in range(1+l[0]):
    for j in range(1+l[1]):
        ans=x-500*i-100*j
        
        if ans>=0 and ans<=50*l[2]:
            count+=1
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def count(a, b, c, x):
    A = 10
    B = 2

    x /= 50

    count = 0
    for an in range(0, a+1):
        for bn in range(0, b+1):
            if 0 <= (x - (an * A + bn * B)) <= c:
                count += 1

    return count


a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(count(a, b, c, x))

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 i in range(4)]

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

Submission status: Accepted

Solution code:
# ABC 087: B – Coins
a, b, c, x = [int(input()) for _ in range(4)]
number_of_ways = 0

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

print(number_of_ways)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a=int(input())
b=int(input())
c=int(input())
d=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==d:
                ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    A, B, C, X = map(int, readlines())

    cnt = 0
    for i in range(A+1):
        s0 = i * 500
        if s0 > X:
            break

        for j in range(B+1):
            s1 = s0 + j * 100
            if s1 > X:
                break

            for k in range(C+1):
                s = s1 + k * 50
                if s == X:
                    cnt += 1
                elif s > X:
                    break

    print(cnt)


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

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


print(count)

Submission status: Accepted

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

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

print(ptn)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
result = 0
for num_a in range(a+1):
  for num_b in range(b+1):
    rest = x - 500*num_a - 100*num_b
    if rest >= 0 and c >= int(rest / 50):
      result += 1
print(result)

Submission status: Accepted

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

con = 0
i,j,k = 0,0,0
while i <= a:
  while j <= b:
    while k <= c:
      if x - 500*i - 100*j - 50*k == 0:
        con += 1
      k += 1
    j += 1
    k=0
  i += 1
  j=0

print(con)

Submission status: Accepted

Solution code:
# 計算量を絞らずに実験
A=int(input())
B=int(input())
C=int(input())
X=int(input())

A_i=min(X//500,A)+1
B_i=min(X//100,B)+1
C_i=min(X//50,C)+1

ans=0

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

Submission status: Accepted

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

A_i=min(X//500,A)+1
B_i=min(X//100,B)+1
C_i=min(X//50,C)+1

ans=0

for i in range(0,A_i):
    for j in range(0,B_i):
        for k in range(0,C_i):
            if i*500+j*100+k*50==X:ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    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)

main()

Submission status: Accepted

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

ans = 0
for _a in range(a+1):
    for _b in range(b+1):
        for _c in range(c+1):
            if _a*500 + _b*100 + _c*50 == x:
                ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a = inp()
b = inp()
c = inp()
x = inp()
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
                break
print(res)

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-06 14:53:37(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    a, b, c, x = (int(i) for i in sys.stdin.read().split())

    combination = 0
    for i in range(a+1):
        ta = 500 * i
        if ta == x:
            combination += 1
            continue
        elif ta> x:
            continue
        for j in range(b+1):
            tb = 100 * j
            if ta + tb == x:
                combination += 1
                continue
            elif ta + tb > x:
                continue
            for k in range(c+1):
                total = ta + tb + 50 * k
                if total == x:
                    combination += 1
    
    print(combination)

if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for p in range(A+1):
    for q in range(B+1):
        for r in range(C+1):
            if (X - 500*p - 100*q - 50*r) == 0:
                ans += 1
                
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(pat)

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 = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for a in range(A+1):
  change = X
  if change - a*500 < 0:
    break
  else:
    change -= a*500
    for b in range(B+1):
      change_b = change
      if change_b - b*100 < 0:
        break
      else:
        change_b -= b*100
        for c in range(C+1):
          if change_b == c*50:
            ans += 1
            break
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):
  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())

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

if __name__ == '__main__':
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())

    cnt = 0
    M = 0

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

    print(cnt)

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for 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):
            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):
    ts = i * 500 + j * 100
    if x - ts >= 0 and (x - ts) % 50 == 0 and (x - ts) // 50 <= c:
      ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
a = int(input())
b = int(input())
c = int(input())
s = int(input())

num = 0
a_list, b_list, c_list = np.array(range(a+1)), np.array(range(b+1)), np.array(range(c+1))

for al in a_list:
    for bl in b_list:
        for cl in c_list:
            summy = 500*al + 100*bl +50*cl
            if summy==s:
                num += 1
print(num)

Submission status: Accepted

Solution code:
a1 = int(input())
b1 = int(input())
c1 = int(input())
x1 = int(input())

co = 0
for a2 in range(0,a1+1):
    for b2 in range(0,b1+1):
        for c2 in range(0,c1+1):
            if a2*500 + b2*100 + 50 *c2 == x1:
                co += 1
print(co)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


x=X/50

count=0

for i in range(a+1):
  for l in range(b+1):
    if 0<=x-i*10-l*2<=c:
      count+=1
      
print(count)

Submission status: Accepted

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

main()

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

Submission status: Accepted

Solution code:
def pay500():
    a_max = min(int(x / 500), a)

    return [x - 500 * i for i in range(a_max + 1)]


def pay100(pay: int):
    b_max = min(int(pay / 100), b)
    return [pay - i * 100 for i in range(b_max + 1)]


def pay50(pay_list: list):
    def canPay(pay: int):
        if 50 * c >= pay:
            return True
        else:
            return False

    return list(map(canPay, pay_list))


def judge():
    def countTrue(l: list, count: int, remain: int):
        count += l[remain].count(True)
        if remain > 0:
            countTrue(l, count, remain - 1)
        else:
            print(count)

    a_list = pay500()
    b_list = list(map(pay100, a_list))
    c_list = list(map(pay50, b_list))
    c_len = len(c_list)

    countTrue(c_list, 0, c_len - 1)


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

judge()

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
z = 0
number = 0
for i in range(a+1):
    for g in range(b+1):
        for h in range(c+1):
            z = 500*i + 100*g + 50*h
            if x == z:
                number += 1

print(number)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n_500 = int(input())
n_100 = int(input())
n_50 = int(input())
price = int(input())
count = 0

for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if(price ==500*i+100*j+50*k):
                count+=1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = 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 ai in range(A+1):
    for bi in range(B+1):
        for ci in range(C+1):
            if 500*ai + 100*bi + 50*ci == X:
                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):
    q = (X - (a * 500 + b * 100)) / 50
    if q >= 0 and q <= C:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

res = int(0)

for x in range(A+1):
	for y in range(B+1):
		for z in range(C+1):
			total = int(500*x + 100*y + 50*z)
			if(total == 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):
            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())

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
v500 = int(input())
v100 = int(input())
v50 = int(input())
sum = int(input())
count = 0
for i500 in range(v500 + 1):
    if 500 * (v500 - i500) <= sum:
        rest_500 = sum - 500 * (v500 - i500)
        for i100 in range(v100 + 1):
            if 100 * (v100 - i100) <= rest_500:
                rest_100 = rest_500 - 100 * (v100 - i100)
                for i50 in range(v50 + 1):
                    if 50 * (v50 - i50) == rest_100:
                        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C,X = [int(s) for s in 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:
#2019/10/25
A,B,C,X =[int(s) for s in open(0)]
# print(A,B,C,X)
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())
sum = 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:
        sum += 1
print(sum)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
(500*A)+(100*B)+(50*C)
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())

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

Submission status: Accepted

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

ans=0

for i in range(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:
#input
A = int(input())
B = int(input())
C = int(input())
X = int(input())
#A = list(map(int,input().split()))
#b = int(input())

#s = [0,0,0]
#s[0] = int(input/100)
#s[1] = int(input/10 - s[0]*10)
#[2] = int(input%10)



count = 0
#flag = 0

for i in range(A+1): #loop for 500円
  for j in range(B+1): #loop for 100円
    temp = X - i*500 - j*100
    if (temp >= 0 ):
      if (temp == 0) or (temp/50 <= C):
        count += 1
        #print('BINGO')
        #print(i)
        #print(j)
        #print(temp)
  
  #judge

#print('result')
#print(A)
print(count)

Submission status: Accepted

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

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n==x for n in temp_list].count(True)
print(ans)

Submission status: Accepted

Solution code:
y500 = int(input())
y100 = int(input())
y50 = int(input())
ysum = int(input())
count = 0

for a in range(y500+1):
  for b in range(y100+1):
    for c in range(y50+1):
      if ysum == a*500 + b*100 + c*50:
        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 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 c in range(0,C+1):
	if c*50 > X :
		break
	for b in range(0,B+1):
		if c*50+b*100 > X:
			break
		for a in range(0,A+1):
			if a*500+b*100+c*50 > X:
				break
			if a*500+b*100+c*50 == X:
				count += 1
print(count)

Submission status: Accepted

Solution code:
A_having = int(input())
B_having = int(input())
C_having = int(input())
X = int(input())

patterns = 0
for a in range(A_having + 1):
    for b in range(B_having + 1):
        for c in range(C_having + 1):
            total = a * 500 + b * 100 + c * 50
            if total == X:
                patterns += 1

print(patterns)

Submission status: Accepted

Solution code:
#cording:utf-8

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

cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input()) # num of 500 coins
B = int(input()) # num of 100 coins
C = int(input()) # num of  50 coins
X = int(input()) # amount of payment

ans = 0

Bmax = B * 100
Cmax = C * 50

for a in range(A+1):
    b = 0
    rest = X - 500 * a
    if rest < 0:
        break
    if rest > Bmax + Cmax:
        continue
    if rest == 0:
        ans += 1
        # print(a,b,rest)
        continue
    else: # 0 < rest <= Bmax + Cmax
        for b in range(B+1):
            rest = X - 500 * a - 100 * b
            if rest < 0:
                break
            if rest > Cmax:
                continue
            else: # 0 <= rest <= Cmax
                ans += 1
                # print(a,b,rest)

print(ans)

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

counter=0

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

print(counter)