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:

input_lines1 = input()
int_a = int(input_lines1)
input_lines2 = input()
int_b = int(input_lines2)
input_lines3 = input()
int_c = int(input_lines3)
input_lines4 = input()
int_x = int(input_lines4)
count = 0
for i in range(int_c + 1):
    for j in range(int_b + 1):
        for h in range(int_a + 1):
            if (i * 50) + (j * 100) + (h * 500) == int_x:
                count = count + 1



print(int(count))

Submission status: Accepted

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

goukei=0
for a in xrange(A+1):
	tempA = a*500
	for b in xrange(B+1):
		tempB = b*100
		for c in xrange(C+1):
			if (tempA+tempB+50*c) == X:
				goukei=goukei+1
print(goukei)

Submission status: Accepted

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


def slove(a, b, c, x):
    ans = 0
    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                tmp = x - 500*i - 100*j
                if tmp == 0:
                    ans += 1
                    break
                if tmp > 0 and tmp <= 50*k:
                    ans += 1
                    break

    return ans


if __name__ == "__main__":
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    print(slove(a, b, c, x))

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
ca = int(x/500)
if(ca>a):
    ca = a

for i in range(ca+1):
    ax = x - 500*i
    cb = int(ax/100)
    
    for j in range(cb+1):
        if(j>b):
            continue
        bx = x - 500*i - 100*j
        cc = int(bx/50)
        
        if(cc>c):
            continue
        
        cnt += 1


print(cnt)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    
    a = int(raw_input())
    b = int(raw_input())
    c = int(raw_input())
    x = int(raw_input())
    
    count = 0
    na = x / 500
    for i in range(na+1):
        nb  =   (x-i*500)/100
        for j in range(nb+1):
            nc = (x-i*500-j*100)/50
            if (i <= a) & (j <= b) & (nc <= c):
                count += 1
                
    print count

Submission status: Accepted

Solution code:
c=int(input())
b=int(input())
a=int(input())
t=int(input())
t=t//50
m=0
sum=0
while(m<=a):
	n=0
	while(n<=b):
		o=0
		while(o<=c):
			if(m+(2*n)+(10*o)==t):
				sum+=1
			o+=1
			if(m+(2*n)+(10*o)>t):
				break
		n+=1
	m+=1			
print(sum)

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

Submission status: Accepted

Solution code:
from itertools import product

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

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

costs = [0, 0, 0]

for num_a in xrange(a + 1):
    costs[0] = num_a * 500

    for num_b in xrange(b + 1):
        costs[1] = num_b * 100

        for num_c in xrange(c + 1):
            costs[2] = num_c * 50
            if sum(costs) == x:
                count += 1

print count

Submission status: Accepted

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

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

Submission status: Accepted

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

print(pattern)

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):
        #print("p:{}, q:{}, (x - p*500 - q*100) // 50:{}".format(p, q, (x - p*500 - q*100) // 50))
        if (x - p*500 - q*100) // 50 <= c and (x - p*500 - q*100) // 50 >= 0:
            ans += 1
            #print("hit")
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 = count + 1

print(count)

Submission status: Accepted

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

count = 0
for k in range(a+1):
  if x-500*k < 0:
    break
  for j in range(b+1):
    if x-500*k-100*j < 0:
      break
    if (x-500*k-100*j)//50 > c:
      continue
    count += 1
print(count)

Submission status: Accepted

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

cnt = 0
sum = 0

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

Submission status: Accepted

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

cnt = 0
for adx in range(a+1):
    for bdx in range(b+1):
        for cdx in range(c+1):
            if(adx * 500 + bdx * 100 + cdx * 50 == x):
                cnt += 1

print(cnt)

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

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

    print(cnt)

Submission status: Accepted

Solution code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
target = int(input())
count = 0

for i in range(coin_500 + 1):
    for j in range(coin_100 + 1):
        for k in range(coin_50 + 1):
            if i * 500 + j * 100 + k * 50 ==  target:
                count += 1
                # print(str(i) + str(j) + str(k))

print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
x = x / 50
total = a+b+c
lists = []
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:
                lists.append(b)

length = len(lists)
print(length)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
x=X/50
def bcpair(y):
    count=0
    for b in range(B+1):
        if y-(2*b)>=0 and y-(2*b)<=C:
            count+=1
    return(count)
result=0
a=0
while a<=A and x-(10*a)>=0:
    result+=bcpair(x-(10*a))
    a+=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):
    if (X-500*i) < 0:
        continue
    for j in range(B+1):
        if (X-500*i-100*j) < 0:
            continue
        elif (X-500*i-100*j)//50 <= C and (X-500*i-100*j)%50 == 0:
            cnt += 1
print(cnt)

Submission status: Accepted

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

i = 0
p = 0
while i <= a:
    j = 0
    while j  <= b:
        k = 0
        while k <= c:
            if x == 500 * i + 100 * j + 50 * k:
                p += 1
            k += 1
        j += 1
    i += 1
print(p)

Submission status: Accepted

Solution code:
# from collections import deque
# from collections import defaultdict
# from collections import Counter
# from itertools import permutations

def main():
    A, B, C, X = [int(input()) for _ in [0] * 4]

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

main()

Submission status: Accepted

Solution code:
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    tt = int(input())
    total = 0

    for yen500 in range(a+1):
        for yen100 in range(b+1):
            for yen50 in range(c+1):
                if yen500 * 500 + yen100 * 100 + yen50 * 50 == tt:
                    total += 1

    print(total)

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

Submission status: Accepted

Solution code:
def solve():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input()) // 50
    cnt = 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:
                    cnt += 1

    print(cnt)
solve()

Submission status: Accepted

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

choice_cnt = 0

for i in range(a+1):
    tmp_sum_a = i*500
    if tmp_sum_a > x:
        continue
    elif tmp_sum_a == x:
        choice_cnt += 1
        continue
    for j in range(b+1):
        tmp_sum_b = tmp_sum_a + j*100
        if tmp_sum_b > x:
            continue
        elif tmp_sum_b == x:
            choice_cnt += 1
            continue
        for k in range(c+1):
            tmp_sum_c = tmp_sum_b + k*50
            if tmp_sum_c > x:
                continue
            elif tmp_sum_c == x:
                choice_cnt += 1

print(choice_cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ちょうど、なので引いていって0になったらbreak
a, b, c, x = int(input()), int(input()), int(input()), int(input())
cnt = 0
for i in range(0, a+1):
    if 500*i>x:
        break
    for j in range(0, b+1): 
        if 500*i+100*j>x:
            break
        for k in range(0, c+1):
            if 500*i+100*j+50*k>x:
                break
            elif 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(0,x//500+1):
    if i<=a:
        for j in range((x-500*i)//100+1):
            if j<=b:
                for k in range((x-500*i-100*j)//50+1):
                    if k<=c:
                        if (500*i+100*j+50*k)==x:
                            cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
gohyaku = int(input())
hyaku = int(input())
goju = int(input())
saisyu = int(input())

pattern = 0

for i in range(gohyaku+1):
    imagohya = saisyu - (i * 500)
    if imagohya == 0:
        pattern += 1
    elif imagohya > 0:
        for j in range(hyaku+1):
            imahya = imagohya - (j*100)
            if imahya == 0:
                pattern += 1
            elif imahya > 0:
                for k in range(goju+1):
                    imagoju = imahya - (k * 50)
                    if imagoju == 0:
                        pattern += 1

print(pattern)

Submission status: Accepted

Solution code:
A = int(raw_input()) # 500
B = int(raw_input()) # 100
C = int(raw_input()) #  50
X = int(raw_input()) # object

# 500*s + 100*t + 50*u = X
# 0<=s<=A, 0<=t<=B, 0<=u<=C

count = 0

for s in range(A+1):
    for t in range(B+1):
        for u in range(C+1):
            if (500*s + 100*t + 50*u == X):
#                print s, t, u
                count += 1
            else:
                pass

print count

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
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(raw_input()) #500
b = int(raw_input()) #100
c = int(raw_input()) #50
x = int(raw_input())

xcount=0

q=min(x/500,a)
for i in range(q+1):
   y=x-500*i
   r=min(y/100,b)
   for j in range(r+1):
      z=y-100*j
      if (z%50==0 and (z/50)<=c) :xcount=xcount+1

print xcount

Submission status: Accepted

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

S = [(A,B,C),]
ans = 0
while len(S) > 0:
    a, b, c = S.pop()
    s = 500*a+100*b+50*c
    if s == X:
        ans += 1
    if c > 0:
        S.append((a, b, c-1))
    elif b > 0:
        S.append((a, b-1, C))
    elif a > 0:
        S.append((a-1, B, C))
print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log
from itertools import *
import string
import copy
import random
import bisect
from decimal import *
def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).split())
a=input()
b=input()
c=input()
x=input()
a+=1
b+=1
c+=1
ans=0
for i in range(a):
	for j in range(b):
		for k in range(c):
			if (i*500+j*100+k*50)==x:
				#print i,j,k
				ans+=1
print ans

Submission status: Accepted

Solution code:
a = eval(input())
b = eval(input())
c = eval(input())
x = eval(input())
count = 0
le = x // 50
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 and i * 10 + j * 2 + k <= le :
                count += 1
print(count)

Submission status: Accepted

Solution code:
# coding: UTF-8

def h(z,C):
  if 50*C >= z:
    return 1
  else:
    return 0

def g(y,B,C):
  ans = 0
  i = 0
  while 100*i <= y and i <= B:
    ans += h(y-100*i,C)
    i += 1
  return ans

def f(x,A,B,C):
  ans = 0
  i = 0
  while 500*i <= x and i <= A:
    ans += g(x-500*i,B,C)
    i += 1
  return ans

def solve():
  A = int(input())
  B = int(input())
  C = int(input())
  X = int(input())
  return str(f(X,A,B,C))
 
if __name__ == '__main__':
  ans = solve()
  print(ans, flush=True)

Submission status: Accepted

Solution code:


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    ans = 0

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

Submission status: Accepted

Solution code:
import collections
from pprint import pprint as pp

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

result = 0

for x500 in range(a+1):
  now_500 = 500 * x500
  if now_500 > x:
    break
  for x100 in range(b+1):
    now_100 = 100 * x100 + now_500
    if now_100 > x:
      break
    rem = (x - now_100) / 50
    if rem <= c:
      result += 1
print(result)

Submission status: Accepted

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

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

print(T)

Submission status: Accepted

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

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

print(K)

Submission status: Accepted

Solution code:
import numpy as np

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

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

print(num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c = int(input()), int(input()), int(input())
x = int(input())
value = 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: continue
                        elif sum == x: value+=1
                        else: continue
print(value)

Submission status: Accepted

Solution code:
def solve():
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    # least
    ans = 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:
                    ans += 1
    print(ans)
    return

solve()

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())/50
count=0
for i in range(A+1):
    for i2 in range(B+1):
        for i3 in range(C+1):
            if i*10+i2*2+i3==X:
                count+=1
print(count)

Submission status: Accepted

Solution code:


def wa(x,y,z): #500 100 50
    global ans,a,b,c,n
    if x>a or y>b or z>c:
        return
    if x*500+y*100+z*50==n:
        ans+=1
        return
    elif x*500+y*100+z*50>n:
        return
    else:
        wa(x+1,y,z)
        wa(x,y+1,z)
        wa(x,y,z+1)
import math

def main():
    temp=input()
    a=int(temp)
    temp=input()
    b=int(temp)
    temp=input()
    c=int(temp)
    temp=input()
    n=int(temp)
    ans = 0
    for x in range(a+1):
        for y in range(b+1):
            for z in range(c+1):
                if 500*x+100*y+50*z==n:
                    ans+=1
                    
    print(ans)

    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = input()
b = input()
c = input()
x = input()

max_a = x / 500

count = 0
# print max_a
for i in range(0, min(a, max_a) + 1):
    rest = x - i * 500
    max_b = rest / 100
    # print rest, max_b
    for j in range(0, min(b, max_b) + 1):
        rest_c = rest - j * 100
        if rest_c <= c * 50:
            count += 1

print count

Submission status: Accepted

Solution code:
# coding=utf-8

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

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

print(ret)

Submission status: Accepted

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

count = 0

while x >= 0 and a >= 0:
    y = x
    bb = b
    while y >= 0 and bb >= 0:
        if 50 * c >= y:
            count += 1
        y = y - 100
        bb -= 1
    x = x - 500
    a = a - 1

print(count)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
counter = 0
for a in range(0, min(41, A+1)):
    for b in range(0, B+1):
        for c in range(0, C+1):
            if 500 * a + 100 * b + 50 * c == X:
                counter += 1
print(counter)

Submission status: Accepted

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

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

res = 0

for i in range(A+1):
	remain = X - 500 * i
	if i < 0:
		break
	for j in range(B+1):
		rem = X - 500 * i - 100 * j
		if rem < 0:
			break;
		for k in range(C+1):
			r = X - 500 * i - 100 * j - 50 * k
#			print("i:", i, "j:" ,j, "k:", k, "r:", r);
			if r < 0:
				break
			elif r == 0:
				res += 1

print(res)

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

Submission status: Accepted

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

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

counter = 0
for a in range(A+1):
    for b in range(B+1):
        c = X//50 - 10*a - 2*b
        if (0<=c<=C) and 500*a+100*b+50*c == X:
            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):
            if i*500 + j*100 + k*50 == x: ans += 1

print(ans)

Submission status: Accepted

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

    f(A, B, C, X)


def f(A, B, C, X):
    ans = 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
                if s == 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):
            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 (500*i+100*j+50*k)==X:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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 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 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:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

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

cnt = 0
for i in 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:
n_five_hundred_coin = int(input())
n_hundred_coin = int(input())
n_fifty_coin = int(input())
total_money = int(input())

n_pattern = 0
for five_hundred_coin in range(n_five_hundred_coin+1):
  # この時点で合計を超えていればアウト
  if five_hundred_coin * 500 > total_money:
    break

  for hundred_coin in range(n_hundred_coin+1):
    # この時点で合計を超えていればアウト
    if five_hundred_coin * 500 + hundred_coin * 100 > total_money:
      break

    remain_money = total_money - five_hundred_coin * 500 - hundred_coin * 100
    need_fifty_coin = remain_money / 50

    if need_fifty_coin <= n_fifty_coin:
      n_pattern += 1

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

print(count)

Submission status: Accepted

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

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

print(result)

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())
q=0
i=0
while i<=a and (i*500)<=x:
    j=0
    while j<=b and (i*500+j*100)<=x:
        k=0
        while k<=c:
            if (i*500+j*100+k*50)==x:
                q+=1
                break
            k+=1
        j+=1
    i+=1
print(q)

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):
    if 500 * a > X:
        continue
    for b in range(B+1):
        if 500 * a + 100 * b > X:
            continue
        for c in range(C+1):
            if 500 * a + 100 * b + 50 * c > X:
                continue
            sum = 500 * a + 100 * b + 50 *c
            if sum == X:
                count += 1

print(count)