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: Runtime Error

Solution code:
import numpy as np
A = input()
B = input()
C = input()
X = input()
count = 0
coin = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a + b + c == 0:
        continue
      else:
        if X == coin.dot(np.array([a,b,c])):
            count += 1
print(count)

Submission status: Runtime Error

Solution code:
import numpy as np
A = input()
B = input()
C = input()
X = input()
count = 0
c = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if (a == 0 and b == 0 and c == 0):
        break
      else:
        if (np.array([a,b,c]) * c).sum() == X:
          count += 1
print(count)

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
X = input()
count = 0
c = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if (a == 0 and b == 0 and c == 0) or (a+b+c)>50:
        break
      else:
        if (np.array([a,b,c]) * c).sum() == X:
          count += 1
print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(4):
    list += [int(input())]

count = 0
for ii in range(list[0] + 1):
    for jj in range(list[1] + 1):
        for kk in range(list[2] + 1):
            if list[3] == 500 * ii + 100 * jj + 50 * kk:
                count += 1
            else if list[3] < 500 * ii + 100 * jj + 50 * kk:
                break

print(count)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
n=int(input())
ans=0
for i in range(a):
  for j in range(b):
    if 500*i+100*j>n:
      break
    else:
      (n-500*i-100*j)%50==0 and (n-500*i-100*j)//50<=c:
        ans+=1
  if 500*i>n:
    break
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
n=6000
ans=0
for i in range(1000):
  for j in range(1000):
    if 500*i+100*j>n:
      break
    else:
      (n-500*i-100*j)%50==0:
        ans+=1
  if 500*i>n:
    break
print(ans)

Submission status: Runtime Error

Solution code:
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a):
    for ii in range(b):
      for iii in range(c):
        if x==500*i+100*ii+50*iii:
          ans+=1
          
  return ans
a=input()
b=input()
c=input()
x=input()
print(tyoudo(a,b,c,x))

Submission status: Runtime Error

Solution code:
def solve(string):
    a, b, c, x = map(int, string.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
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Runtime Error

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

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: Runtime Error

Solution code:
c500 = int(input())
c100 = int(input())
c500 = int(input())
t = int(input())
s = 0

for a in range(0, c500 + 1):
    for b in range(0, c100 + 1):
        for c in range(0, c50 + 1):
            if 500*a + 100*b + 50*c == t:
                s = s + 1
print(s)

Submission status: Runtime Error

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: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
if 50=>A=>0 and 50=>B=>0 and 50=>C=>0 and (A+B+C)=>1 and 50=<X=<20000 and X%50==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: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
maxa = min([a,x//500])
maxb = min([b,x//100])
maxc = min([c,x/50])
count = 0
for i in range(maxa + 1):
    for j in range(maxb + 1):
        for k in range(maxc + 1):
            if 10*i + 2*j + k == x/50:
                count += 1
print(count)

Submission status: Runtime Error

Solution code:
A, B, C, X  = map(int, input().split())
tmp = 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:
                tmp += 1    
print(tmp)

Submission status: Runtime Error

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

#%%

n = 0
for fiveHundred in a:
    for hundred in b:
        for fifty in c:
            if x == 500*fiveHundred + 100*hundred + 50*fifty:
                n +=1

print(n)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
al = range(a+1)
bl = range(b+1)
for i in al:
    for p in bl:
        if (((x-al*500-bl*100) % 50) == 0) and (0 <= (x-al*500-bl*100)):
            count += 1
        else:
            break
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,x=[int(input())+1for _ in[0]*4];print(len(0for s in range(a)for t in range(b)for r in range(c)if x-1==(10*s+2*t+r)*50))

Submission status: Runtime Error

Solution code:
nums = [input() for i in range(2)]
A,B,C = map(int,nums)
x = int(input())
  
count = 0
for i in range(A):
  if i*500 == x:
    count += 1
    break
  else:
    x -= i*500
    for j in range(B):
      if j*100 == x:
        count += 1
        break
      else:
        x -= j*100
        for k in range(C):
          if k*50 == x:
            count += 1
            break
print(count)

Submission status: Runtime Error

Solution code:
nums = [input() for i in range(2)]
A,B,C = map(int,nums)
x = int(input())
  
count = 0
for i in range(A):
  if i*500 == x:
  	count += 1
  	break
  else:
    x -= i*500
    for j in range(B):
		if j*100 == x:
		  count += 1    		
		  break
        else:
          x -= j*100
          for k in range(C):
            if k*50 == x:
    		  count += 1
      		  break
print(count)

Submission status: Runtime Error

Solution code:
nums = [input() for i in range(2)]
A,B,C = map(int,nums)
x = int(input())
  
count = 0
for i in range(A):
  if i*500 == x:
    count += 1
    break
  else:
    x -= i*500
    for j in range(B):
  		if j*100 == x:
    	  count += 1    		
  		  break
        else:
          x -= j*100
          for k in range(C):
            if k*50 == x:
    		  count += 1
      		  break
print(count)

Submission status: Runtime Error

Solution code:
 = int(input())
b = int(input())
c = int(input())
x = int(input())
counter = 0
for gohyaku in a:
   x = x - 500 *gohyaku
   for hyaku in b:
      x  = x - 100*hyaku
      if 0 <= x <= 50*c:
         counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counter = 0
for gohyaku in a:
   x = x - 500 *gohyaku
   for hyaku in b:
      x  = x - 100*hyaku
      if 0 <= x <= 50*c:
         counter += 1

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
Count = 0
while(1):
    count = 0
    for i in range(n):
        if a[i] % 2 == 0:
            count += 1
    if count != n:
        break
    for i in range(n):
        a[i] /= 2
    Count += 1
print(Count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
x = input()
count = 0
for i in range(min(x / 500, a)):
    for j in range(min((x - i * 500) / 200, b)):
        if (x - i * 500 - j * 100) / 50 <= c:
            count += 1
print(count)

Submission status: Runtime Error

Solution code:
def main(A, B, C, X):
    # type: (int, int, int, int) -> None
    coins = [
        (a,b,c)
        for a in range(A)
        for b in range(B)
        for c in range(C)
        if 500*a + 100*b + 50*c == X
    ] # type: List[Tuple[int, int, int]]
    print(len(coins))

if __name__ == '__main__':
    A,B,C,X,*_ = list(map(int, input().split()))
    main(A,B,C,X)

Submission status: Runtime Error

Solution code:
line = input().split(" ")
a = int(line[0])
b = int(line[1])
c = int(line[2])
x = int(input())
count = 0

for ia in range(a+1):
    for jb in range(b+1):
        for kc in range(c+1):
            if(0 == (x - (ia*500 + jb*100 + kc*50))):
                count += 1

print(count)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
ma = x // a
mb = x // b
mc = x // c
for i500 in range(ma+1):
  for i100 in range(mb+1):
    for i50 in range(mc+a):
      if 500*i500 + 100*i100 + 50*i50 == x:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
def solve(an, bn, cn, X):
    a = [[], 0]

    def loop(c, A, B, C, a):
        if c == 0:
            if check(a[0], an-A, bn-B, cn-C):
                a[0].append([an-A, bn-B, cn-C])
                a[1] += 1
        if A > 0 and c >= 500:
            loop(c-500, A-1, B, C, a)
        if B > 0 and c >= 100:
            loop(c-100, A, B-1, C, a)
        if C > 0 and c >= 50:
            loop(c-50, A, B, C-1, a)

    loop(X, an, bn, cn, a)

    return a[1]


if __name__ == '__main__':
    Ain = int(input())
    Bin = int(input())
    Cin = int(input())
    Xin = int(input())

    print(solve(Ain, Bin, Cin, Xin))

Submission status: Runtime Error

Solution code:
import itertools
import sys


def main(argv):
    inputs = [int(v.rstrip()) for v in argv]
    A = inputs[0]
    B = inputs[1]
    C = inputs[2]
    X = inputs[3]

    cnt = 0
    for n_500, n_100, n_50 in itertools.product(range(A), range(B), range(C)):
        if 500 * n_500 + 100 * n_100 + 50 * n_50 == X:
           cnt += 1

    print(cnt)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Runtime Error

Solution code:
import itertools
import sys


def main(argv):
    inputs = [int(v) for v in argv]
    A = inputs[0]
    B = inputs[1]
    C = inputs[2]
    X = inputs[3]

    cnt = 0
    for n_500, n_100, n_50 in itertools.product(A, B, C):
        if 500 * n_500 + 100 * n_100 + 50 * n_50 == X:
           cnt += 1

    print(cnt)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Runtime Error

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

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

print(k)

Submission status: Runtime Error

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

X /= 50
if X%2==1:
    if C==0:
        print(0)
        quit()
    X -= 1
    C -= 1
C /= 2
D1 = min(B,C)
D2 = max(B,C)
D1 = int(min(D1,X/2))
D2 = int(min(D2,X/2))
i0 = int(X/10)
start = i0-int(min(A,X/10))
alpha = int(D1/(10/2))
beta = int(D2/(10/2))
end = i0-int(max((X-2*(D1+D2))/10,0))
n = max(alpha-start,0)
alpha_count = int( (10/2)/2*(n)*(n-1) + n*6 )
n = max(beta-alpha,0)
beta_count = n*(D1+1)
n = end-beta + (0 if X>10 else 1)
gumma_count = int( (10/2)/2*(n)*(n-1) + n*(D1+D2-5*end + (0 if D1==D2 else 1)) )
print( int(alpha_count+beta_count+gumma_count) + (1 if X>10 else 0) )

Submission status: Runtime Error

Solution code:
def calc(A,B,C,X):
    X /= 50
    if X%2==1:
        if C==0:
            return 0
        X -= 1
        C -= 1
    C /= 2
    D1 = min(B,C)
    D2 = max(B,C)
    D1 = int(min(D1,X/2))
    D2 = int(min(D2,X/2))

    i0 = int(X/10)
    start = i0-int(min(A,X/10))
    alpha = int(D1/(10/2))
    beta = int(D2/(10/2))
    end = i0-int(max((X-2*(D1+D2))/10,0))

    n = max(alpha-start,0)
    alpha_count = int( (10/2)/2*(n)*(n-1) + n*6 )
    n = max(beta-alpha,0)
    beta_count = n*(D1+1)
    n = end-beta + (0 if X>10 else 1)
    gumma_count = int( (10/2)/2*(n)*(n-1) + n*(D1+D2-5*end + (0 if D1==D2 else 1)) )
    return ( int(alpha_count+beta_count+gumma_count) + (1 if X>10 else 0) )

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

print(calc(A,B,C,X))

Submission status: Runtime Error

Solution code:
def calc(A,B,C,X):
    X /= 50
    if X%2==1:
        if C==0:
            return 0
        X -= 1
        C -= 1
    C /= 2
    D1 = min(B,C)
    D2 = max(B,C)
    D1 = int(min(D1,X/2))
    D2 = int(min(D2,X/2))

    i0 = int(X/10)
    start = i0-int(min(A,X/10))
    alpha = int(D1/(10/2))
    beta = int(D2/(10/2))
    end = i0-int(max((X-2*(D1+D2))/10,0))

    n = max(alpha-start,0)
    alpha_count = int( (10/2)/2*(n)*(n-1) + n*6 )
    n = max(beta-alpha,0)
    beta_count = n*(D1+1)
    n = end-beta + (0 if X>10 else 1)
    gumma_count = int( (10/2)/2*(n)*(n-1) + n*(D1+D2-5*end + (0 if D1==D2 else 1)) )
    print(alpha_count,beta_count,gumma_count)
    return ( int(alpha_count+beta_count+gumma_count) + (1 if X>10 else 0) )

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

print(calc(A,B,C,X))

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=map(int,input().split())
s=input()
print("{} {}".format(a+b+c,s))



a,b=map(int,input().split())
p=a*b
if p%2==0:
	print("Even")
else:
	print("Odd")


i=input()
print(count('1'))




N=int(input())
a=list(map(int,input().split()))

n=0
flag = 1

while flag:
	for i in range(len(a)):
		if a[i]%2==0:
			a[i]=a[i]//2
		else:
			flag = 0
	n=n+1

print(n-1)


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

print(count)

Submission status: Runtime Error

Solution code:
def main():
    a, b, c, x = [int(input()) for _ in range(4)]
    coins = ((500, a), (100, b), (50, c))

    print(solve(coins, x))

def solve(coins, x):
    if len(coins) == 1:
        if coins[0][0] * coins[0][1] >= x and x % coins[0][1] == 0:
            return 1
        else:
            return 0

    t = 0
    for i in range(coins[0][1] + 1):
        r = x - coins[0][0] * i
        if r >= 0:
            t += solve(coins[1:], r)

    return t

main()

Submission status: Runtime Error

Solution code:
import comb

A = int(input())*500//50
B = int(input())*100//50
C = int(input())*50//50
X = int(input())//50

#Aが最大何ユニット使えるかを調べる

if A == 0:
	Max_A = 0

else:
	Max_A = X // 10


counter = 0
# H = 0

for i in range(Max_A + 1):
	res_X = X - 10*i
	## B, Cだけで埋めていく
	if B == 0:
		Max_B = 0
	else:
		Max_B = res_X // 2
	for  j in range(min(Max_B + 1, B//2 + 1)):
		res_X = X - 10*i - 2*j

		# print(Max_A,Max_B,i,j,res_X,C, res_X <= C)
		# H += 1

		if res_X <= C:
			counter += 1
		# # if res_X > C:
		# # 	continue
		# # #二項係数の計算　Aのユニット数はA//10　Bのユニット数はB//10　Cはそのまま
		# # else:
		# 	counter += 1
		# 	# counter += comb.comb(A//10, i)*comb.comb(B//2, j)*comb.comb(C, res_X)
			# print(comb.comb(A//10, i)*comb.comb(B//2, j)*comb.comb(C, res_X), 
				# comb.comb(A//10, i), comb.comb(B//2, j), comb.comb(C, res_X))


print(int(counter))
# print(H)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, input().split())
I = 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:
				I++
for i in range(C + 1):
	for j in range(B + 1):
		for k in range(A + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(B + 1):
	for j in range(A + 1):
		for k in range(C + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(A + 1):
	for j in range(C + 1):
		for k in range(B + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(C + 1):
	for j in range(A + 1):
		for k in range(B + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
for i in range(B + 1):
	for j in range(C + 1):
		for k in range(A + 1):
			if (500 * i) + (100 * j) + (50 * k) == X:
				I++
print(I)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, input().split())
I = 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:
				I++
print(I)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, input().split())
I = 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:
			I++
print(I)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, input().split())
I = 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:
		I++
print(I)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
if K % 2:
    print((N // K) ** 3)
else:
    print((N // K) ** 3 + ((N + K // 2) // K) ** 3)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


aa = 0
for i in range(a):
for j in range(b):
for k in range(c):
  sum = 500 * a + 100 * b + 50 * c
  if sum == x:
    aa += 1
    
# 出力
print("{}".format(aa))

Submission status: Runtime Error

Solution code:
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 = total:
                ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
y = int(input())
z = int(input())

s = int(input())

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


print(a)

Submission status: Runtime Error

Solution code:
# 初見分からず
# 考え方：個数の組み合わせを総当たりで全パターン試せばよい！
a, b, c, x = map(int, [val for val in input()])

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

print(n_pattern)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int A,B,C,D,cnt;
int main(){
    cin>>A>>B>>C>>D;
    D/=50;
    for(int i=0;i<=A;i++){
        for(int j=0;j<=B;j++){
            if(D>=i*10+j*2&&D<=i*10+j*2+C){
                cnt++;
            }
        }
    }
    cout<<cnt;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0

for ac in range(A)
    for bc in range(A)
        for cc in range(A)
            if 500*ac+100*bc+50*cc == X:
                count += 1

print(count)

Submission status: Runtime Error

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

# a = 2
# b = 2
# c = 2
# x = 100

cnt = 0
for i1 in range(0,a+1):
    for i2 in range(0,b+1):
        for i3 in range(0,c+1):
            s = 500*i1+100*i2+50*i3
            if(s==x):
                cnt = cnt + 1
print(cnt)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input()
if ((A+B+C<1) or (A<0 or A>50) or (B<0 or B>50) or (C<0 or C>50) or (X<50 or X > 20000 or X%50!=0)):
    print("条件を満たしてください")
count = 0

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

print (count)

Submission status: Runtime Error

Solution code:
import numpy as np
from termcolor import cprint
import time
import sys
""" 
A = int(input())  #500Yen
B = int(input())  #100Yen
C = int(input())  #50Yen
X = int(input())  # want to make
"""

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

X = int(input())

solutions = []
def check(i,j,k):
    _sum = 500*i+100*j+50*k
    if [i,j,k] in solutions:
        return 0

    if _sum == X:
        return 1
    else:
        return 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if check(i,j,k)==1:
                solutions += [[i,j,k]]
            else:
                continue
print(len(solutions))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
input(int(count))

Submission status: Runtime Error

Solution code:
a,b,c,x=map(int,input().split())
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: Runtime Error

Solution code:
a,b,c,x=map(int,input().split())
val=0
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: Runtime Error

Solution code:
A, B, C = map(int, input().split())
X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)

Submission status: Runtime Error

Solution code:
#500
#100
#50
#X
a = int(input())
b = int(input())
c = int(input())
d = int(input())
p = 0
for i in range(a):
  x = d
  x = x-500*i
  if(x==0): 
    p = p+1
    for ii in range(b):
  		x = x-100*i
  		if(x==0):
      	p=p+1
      	for iii in range(c):
  			x = x-50*i
  			if(x==0):
      			p=p+1
 print(p)

Submission status: Runtime Error

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

ret = 0
for ia in range(0, a+1):
    for ib in range(0, b+1):
        for ic in range(0, c+1):
            if 500*ia + 100*ib + 50*ic == x:
                ret += 1
return ret

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = []
for i in range(4):
    s.append(int(input()))

count = 0
for a in range(s[0] + 1):
    for b in range(s[1] + 1):
        for c in range(s[2] + 1):
            if( a*500 + b*100 + c*50 == s[3] ):
                count = count + 1

print(ans)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, input().strip().split())
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: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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

count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            if Xabc == Xab - 50*c == 0:
                count += 1
                break
                
print(count)

Submission status: Runtime Error

Solution code:
def solve(a,b,c,x):
    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
    return count

A,B,C,X = map(int, input().split(" "))
print(solve(A,B,C,X))

Submission status: Runtime Error

Solution code:
def solve(a,b,c,x):
    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
    return count

A,B,C,X = map(int, input().split())
print(solve(A,B,C,X))

Submission status: Runtime Error

Solution code:
def solve(a,b,c,x):
    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
    return count

A,B,C,X = map(int, input().split())
print(solve(A,B,C,X))

Submission status: Runtime Error

Solution code:
# x-500a-100b-5-c = 0 になる方法を探す

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

x = 500a-100b-50c

Submission status: Runtime Error

Solution code:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

for i in [0, A+1]:
    for j in [0, B+1]:
        for k in [0, C+1]:
            int tmp = i * 500 + j * 100 + k * 50
            if (tmp == X):
                ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = I()
    b = I()
    c = I()
    x = I() // 50
    r = [0] * (x+1)
    r[0] = 1
    u = [0] * (x+1)
    for i in range(c):
        r[i+1] = 1
    for i in range(1,b+1):
        for j in range(x):
            if i*2+j > x:
                break
            u[i*2+j] += r[j]
    for i in range(x+1):
        r[i] += u[i]
    u = [0] * (x+1)
    for i in range(1,a+1):
        for j in range(x):
            if i*10+j > x:
                break
            u[i*10+j] += r[j]
    for i in range(x+1):
        r[i] += u[i]

    return r[-1]



print(main())