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:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    pass
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0: #and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            if xB <= B:
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
            else:
                yB = B
                yC = x - xA * 10 - yB * 2
                if yC <= C:
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0: #and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                if xB <= B:
                    yB = xB
                    yC = xC
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                else:
                    yB = B
                    yC = x - xA * 10 - xB * 2
                    if yC <= C:
                        while yB >= 0 and yC <= C:
                            #print(str(yB)+', '+str(yC))
                            yB = yB - 1
                            yC = yC + 2
                            y = y + 1
                        xA = xA -1
                        xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - yB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#例題4
A, B, C, X = map(int, input().split())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0 and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            yB = xB
            yC = xC
            while yB >= 0 and yC <= C:
                #print(str(yB)+', '+str(yC))
                yB = yB - 1
                yC = yC + 2
                y = y + 1
            xA = xA -1
            xB = xB + 5

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(a + 1):
    if 500 * i == x:
        count += 1
        break
    else if 500 * i > x:
        break
    else:
        for j in range(b + 1):
            if 500 * i + 100 * j == x:
                count += 1
                break
            else if 500 * i + 100 * j > x:
                break
            else:
                for k in range(c + 1):
                    if 500 * i + 100 * j + 50 * k == x:
                        count += 1
                        break
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
k,s = map(int,input().split())
l = [a+b for a in range(k+1) for b in range(k+1)]
sum = 0
for i in range(k+1):
  sum += l.count(s-i)
print(sum)

Submission status: Runtime Error

Solution code:

b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m, p = 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def coins(a,b,c,x):
    num=0
    for i in range(a):
        for w in range(b):
            for q in range(c):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a=input()
  b=input()
  c=input()
  x=input()
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def coins(a,b,c,x):
    num=0
    for i in range(a):
        for w in range(b):
            for q in range(c):
                if 500*i + 100*w + 50*q == x:
                    num += 1
    return num
  
def main():
  a,b,c,x=input()
  print(coins(a,b,c,x))
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a, b, c, x = map(int,[input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                count += 1
print(count)

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,[input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                count = count + 1
print(count)

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,[input() for i in range(4)])
c = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                c +=1
print(c)

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,[input() for i in range(4)])
c = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                c = c + 1
print(c)

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,[input() for i in range(4)]
c = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                c = c + 1
print(c)

Submission status: Runtime Error

Solution code:

a = list(map(int,input().split())
c = 0
for x in range(a[0]+1):
    for y in range(a[1]+1):
        for z in range(a[2]+1):
            t = 500*x + 100*y + 50*z
            if t == a[3]:
                c = c + 1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split())
c = 0
for x in range(a[0]+1):
    for y in range(a[1]+1):
        for z in range(a[2]+1):
            t = 500*x + 100*y + 50*z
            if t == a[3]:
                c = c + 1
print(c)

Submission status: Runtime Error

Solution code:
coin=[]
ans=0
for i in range(3):
    coin+=map(int,input().split())
X=int(input())
for a in range(coin[0]+1):
    for b in range(coin[1]+1):
        for c in range(coin[2]+1):
            total=a*500+b*100+c*50
            if total==X:

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC 087 B Coins
A=input()
B=input()
C=input()
X=input()

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

Submission status: Runtime Error

Solution code:
A, B, C, 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):
            sum = 500 * i + 100 * j + 50 * k
            if sum == X:
                ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())/50
n=0
for i in range(x//10+1):
    n+=(x-10*i)//2+1

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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 f in range(c+1):
      if i*500 + j*100 + f*50 == x:
        ans +=1:
            
print(ans)

Submission status: Runtime Error

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 f in range(c+1):
        if i*500 + j*100 + f*50 == x:
          ans +=1:
            
print(ans)

Submission status: Runtime Error

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 f in range(c+1):
        if i*500 + j*100 + f*50 == x:
          ans +=1:
            
print(ans):

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0
for a in range(A+1):
  for b in range(B+1):
     for c 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 h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if total = h *500 + i *100 + j *50 == 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 h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if total = a *500 + b *100 + c *50 == x:
                count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

Solution code:
# coding: utf-8
a=int(input())
b=int(input())
c=int(input())
X=int(input())
l1=X//a
l2=X//b
l3=X//c
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            #p=a*i+b*j+c*k
            #print(p)
            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())
n = 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:
        n += 1
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
cnt = 0
for a in range(0,A+1):
    Y = X - 500*a
    if Y==0:
        cnt += 1
        continue
    elif Y<0:
        break
    for b in range(0,B+1):
        Z = Y - 100*b
        if Z==0:
            cnt += 1
            continue
        elif Z<0:
            break
        if W%50 == 0:
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
cnt = 0
for a in range(0,A+1):
    Y = X - 500*a
    if Y==0:
        cnt += 1
        continue
    elif Y<0:
        continue
    for b in range(0,B+1):
        Z = Y - 100*b
        if Z==0:
            cnt += 1
            continue
        elif Z<0:
            continue
        if W == 0:
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
for a in range(1,A+1):
    Y = X - 500*a
    for b in range(1,B+1):
        Z = Y - 100*b
        for c in range(1,C+1):
            W = Z - 50*c
            if W == 0:
                cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a,b,c,X=[int(input()) for i in range(4)]
for a in range(1,A+1):
    Y = X - 500*a
    for b in range(1,B+1):
        Z = Y - 100*b
        for c in range(1,C+1):
            W = Z - 50*c
            if W == 0:
                cnt += 1
print(cnt)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
print([0 <= X - 500*a - 100*b and X - 500*a - 100*b %
       50 == 0 and X - 500*a - 100*b // 50 <= C for a in A for b in B].count(True))

Submission status: Runtime Error

Solution code:
import functools

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

if min(A, B, C, X) == X:
	print(0)

@functools.lru_cache
def num_patterns(A, B, C, X):
    if X == 0:
      	return 1

    if min(A, B, C, X) == X:
        return 0
    branch_A = num_patterns(A - 1, B    , C    , X - 500) if A > 0 else 0
    branch_B = num_patterns(A    , B - 1, C    , X - 100) if B > 0 else 0
    branch_C = num_patterns(A    , B    , C - 1, X - 50 ) if C > 0 else 0
    return branch_A + branch_B + branch_C

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

Submission status: Runtime Error

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

if min(A, B, C, X) == X:
	print(0)

def num_patterns(A, B, C, X):
    if X == 0:
      	return 1
	if min(A, B, C, X) == X:
    	return 0
    branch_A = num_patterns(A - 1, B    , C    , X - 500) if A > 0 else 0
    branch_B = num_patterns(A    , B - 1, C    , X - 100) if B > 0 else 0
    branch_C = num_patterns(A    , B    , C - 1, X - 50) if C > 0 else 0
    return branch_A + branch_B + branch_C

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

Submission status: Runtime Error

Solution code:
# あなたは、500円玉をA枚、100円玉をB枚、50円玉をC枚持っています。 これらの硬貨の中から何枚かを選び、合計金額をちょうどX円にする方法は何通りありますか。
A,B,C,X=(int(z) for z in input().split())
# A,B,C,X=map(int,'30 30 30 12000'.split())
N=0

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

print(N)

Submission status: Runtime Error

Solution code:
# あなたは、500円玉をA枚、100円玉をB枚、50円玉をC枚持っています。 これらの硬貨の中から何枚かを選び、合計金額をちょうどX円にする方法は何通りありますか。
A,B,C,X=map(int,input().split())
# A,B,C,X=map(int,'30 30 30 12000'.split())
N=0

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

print(N)

Submission status: Runtime Error

Solution code:
# あなたは、500円玉をA枚、100円玉をB枚、50円玉をC枚持っています。 これらの硬貨の中から何枚かを選び、合計金額をちょうどX円にする方法は何通りありますか。
A,B,C=map(int,input().split())
# A,B,C,X=map(int,'30 30 30 12000'.split())
N=0

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

print(N)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
N,A,B = a[0],a[1],a[2]
k = 1
x = True
while x:
    if 10**(k-1) <= N and N < 10**k:
        x = False
    else:
        k += 1
u = 1
M = 0
while u <= k:
    if u == 1:
        v = 1
        while v <= 9:
            if v>= A and v <= B and v <= N:
               M += v
            v += 1
    elif u == 2:
        v,w = 1,0
        while v <= 9:
            while w <= 9:
                 if v+w <=B and v+w >= A and 10*v+w<=N:
                     M += 10*v +w
                 w += 1
            w=0
            v += 1
    else:
        v,w,x =1,0,0
        while v<=9:
            while w <= 9:
                while x <= 9:
                    if v+w+x >= A and v+w+x <= B and 100*v+10*w+x<=N:
                        M += 100*v + 10*w + x
                    x += 1
                x=0
                w += 1
            w=0
            v += 1
    u += 1
print(M)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
m_Coin500 = int(input())
num_Coin100 = int(input())
num_Coin50 = int(input())
total = int(input())

count = 0

for i_Coin500 in range(num_Coin500 + 1):
    for i_Coin100 in range(num_Coin100 + 1):
        for i_Coin50 in range(num_Coin50 + 1):
            sum = 500*i_Coin500 + 100*i_Coin100 + 50*i_Coin50
            if total == sum:
                count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(counter)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Solution code:
gohya, hya, goju = map(int, input('500,100,50').split())
total = int(input('total'))
count = 0
for gh in range(gohya+1):
	for hy in range(hya+1):
		for gj in range(goju+1):
			if 500*gh + 100*hy + 50*gj == total:
				count += 1
print(count)

Submission status: Runtime Error

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

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):
      value = 500*a + 100*b + 50*c 
      if value == 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 a in range(A+1):
  　　for b in range(B+1):
    　　　　for c in range(C+1):
      　　　　　　value = 500*a + 100*b + 50*c 
      　　　　　　if value == X :
        　　　　　	ans += 1
        　　　　　	print(a, b, c)
        

print(ans)

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

Solution code:
import itertools

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

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

print(count)

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

Submission status: Runtime Error

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

a=A/50
b=B/50
c=C/50
x=X/50

count=0

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

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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