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

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

    res = 0
    mA = min(X//500, A)
    for i in range(mA+1):
        Y = X - 500 * i
        mB = min(Y//100, B)
        for j in range(mB+1):
            Z = Y - 100 * j
            if Z <= 50*C:
                res += 1

    print(res)
    
resolve()

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

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

    print(res)
    
resolve()

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
n=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 == n:
                count += 1
print(count)

Solution (Python):


l = []

for i in range(4):
    l.append(int(input()))

x = l[3]
ans = 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 * k == x:
                ans += 1
                
print(ans)

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

Solution (Python):


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

    cnt = 0

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

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
x = int(input())

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

print(y)

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

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

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

count = 0
for i_a in range(a+1):
    sum_a = 500 * i_a
    for i_b in range(b+1):
        sum_b = 100 * i_b
        for i_c in range(c+1):
            sum_c = 50 * i_c
            if x == (sum_a + sum_b + sum_c):
                count += 1

print(count)

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

ans = 0

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

Solution (Python):
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)

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

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

Solution (Python):
a=[]
for q in range(4):
  g=int(input())
  a.append(g)

ans=0
for i in range(a[0]+1):
   for j in range(a[1]+1):
      for k in range(a[2]+1):
      	if a[3]==500*i+100*j+50*k:
        	ans+=1
print(ans)

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

Solution (Python):

def Coins(a , b , c , x):

    count = 0

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

    return count

def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    print(Coins(a , b , c , x))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

Solution (Python):

A = int(input())
B = int(input())
C = int(input())
X = int(input())
price = 0
ans = 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:
                ans += 1

print(ans)

Solution (Python):
s=[[int(j) for j in input().split()] for i in range(4)]
a=s[0]
b=s[1]
c=s[2]
x=s[3]
a=a[0]
b=b[0]
c=c[0]
x=x[0]
count=0
ans=list()
for n in range(a+1):
    for m in range(b+1):
        for l in range(c+1):
            add=n*500+m*100+50*l
            if add==x:
                count+=1
                ans.append([n,m,l])
print(count)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ctn =0
for aa in range(a+1):
    for bb in range(b+1):
        for cc in range(c+1):
            if x == aa*500+bb*100+cc*50:
                ctn += 1
print(ctn)

Solution (Python):
import numpy as np

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

ax_a = np.linspace(0, 500*a, a+1)
ax_b = np.linspace(0, 100*b, b+1)
ax_c = np.linspace(0, 50*c, c+1)

aa, bb, cc = np.meshgrid(ax_a, ax_b, ax_c)
grid = aa+bb+cc
ans = (grid==x).sum()
print(ans)

Solution (Python):


l = [int(input()) for _ in range(4)]


count = 0
for i in range(l[0]+1):
    s = l[3]
    if s - i * 500 >= 0:
        
        for j in range(l[1]+1):
            s = l[3] - i * 500
            if s - j * 100 >= 0:
                
                s -= j * 100
                
                if s // 50 <= l[2]:
                    
                    count += 1
                
print(count)

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

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

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

Solution (Python):
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)

Solution (Python):
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)

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


count = 0
for i_a in range(a + 1):
    for i_b in range(b + 1):
        for i_c in range(c + 1):
            if ((i_a * 500) + (i_b * 100) + (i_c * 50)) == x:
                count += 1
print(count)

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

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

print(ans)

Solution (Python):
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)

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

print(cnt)

Solution (Python):

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




counter = 0 
xa = A
xb = B
xc = C

def purchase(a,b,c):
    return 500 * a + 100 * b + 50 * c

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            
            if(purchase(i,j,k) == X):
                counter += 1
print(counter)

Solution (Python):

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




counter = 0 
xa = A
xb = B
xc = C

def purchase(a,b,c):
    return 500 * a + 100 * b + 50 * c

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            
            if(purchase(i,j,k) == X):
                counter += 1
print(counter)

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

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


res = 0

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

print(res)

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

Solution (Python):
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
            else:
                ans += 0
print(ans)

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

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

print(count)

Solution (Python):
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 = cnt + 1
print(cnt)

Solution (Python):

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

Solution (Python):

a,b,c,x=[int(input()) for i in range(4)]
print(sum([500*p+100*q+50*r==x for p in range(a+1) for q in range(b+1) for r in range(c+1)]))

Solution (Python):
a,b,c,x=[int(input()) for _ in range(4)]
print([500*x+100*y+50*z for z in range(c+1) for y in range(b+1) for x in range(a+1)].count(x))

Solution (Python):
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(int(count))

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

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

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

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

cnt=0
max_500 = int(X/500)
cnt_500 = min(max_500,A)+1

for i in range(cnt_500):
    X_500=X-i*500
    max_100=int(X_500/100)
    cnt_100=min(max_100,B)+1
    
    for j in range(cnt_100):
        X_100=X_500-j*100
        if X_100%50==0 and int(X_100/50)<=C:
            cnt+=1
print(cnt)

Solution (Python):
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)

Solution (Python):
abcx=[int(input()) for _ in range(4)]
count=0
for i in range(abcx[0]+1):
  for j in range(abcx[1]+1):
    if abcx[3]-(500*i+100*j)>=0 and (abcx[3]-(500*i+100*j))%50==0 and (abcx[3]-(500*i+100*j))//50<=abcx[2]:
      count+=1
print(count)

Solution (Python):
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)

Solution (Python):
i = [int(input()) for i in range(4)]
A=i[0]
B=i[1]
C=i[2]
X=i[3]

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

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

Solution (Python):
def is_same(i, j, k, x):
    total = i*500 + j*100 + k*50
    return total==x

coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
x = int(input())
ans = 0
for i in range(coin_500+1):
    for j in range(coin_100+1):
        for k in range(coin_50+1):
            if is_same(i, j, k, x):
                ans = ans + 1
print(ans)

Solution (Python):
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)

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

A = 500
B = 100
C = 50
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            amount = i*A + j*B + k*C
            if amount == x:
                count += 1


print(count)

Solution (Python):
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) for b in range(B+1) for c in range(C+1)))

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

print(count)

Solution (Python):
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)

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

ans = 0
for a1 in range(0,a+1):
    for b1 in range(0,b+1):
        for c1 in range(0,c+1):
            yen = a1*500 + b1*100 + c1*50
            if yen == x:
                ans += 1
print(ans)

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

print(ans)

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

Solution (Python):
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)

Solution (Python):
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)

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

l=[]
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            l.append(500*i+100*j+50*k)
n=0
for i in range(len(l)):
    if l[i]==x:
        n+=1
print(n)

Solution (Python):
import itertools

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)

Solution (Python):
v500 = int(input())
v100 = int(input())
v50 = int(input())
s = int(input())
c = 0
for i in range(v500, -1, -1):
    if 500 * i < s:
        for j in range(v100, -1, -1):
            if 500 * i + 100 * j < s:
                for k in range(v50, -1, -1):
                    if 500 * i + 100 * j + 50 * k == s:
                        c += 1
            elif 500 * i + 100 * j == s:
                c += 1
    elif 500 * i == s:
        c += 1
print(c)

Solution (Python):
A,B,C,X = map(int,open(0))
ans=0
for i in range(0,A+1):
  for j in range(0,B+1):
    tmp = (X - 500*i - 100*j)/50
    if tmp.is_integer() and tmp >=0 and tmp <=C:
      ans +=1
print(ans)

Solution (Python):
N_500 = int(input())
N_100 = int(input())
N_50 = int(input())
X = int(input())

cnt = 0

for i_500 in range(N_500 + 1):
    
    for j_100 in range(N_100 + 1):
        
        for k_50 in range(N_50 + 1):
            
            summ = 500 * i_500 + 100 * j_100 + 50 * k_50
            if (summ == X):
                cnt += 1

print(cnt)

Solution (Python):
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))

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

count = 0

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

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

cnt = 0
price = 0

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

print(cnt)

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

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

ans = 0
for ai in range(a + 1):
    for bi in range(b + 1):
        for ci in range(c + 1):
            if ai * 500 + bi * 100 + ci * 50 == x:
                ans += 1

print(ans)

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

ans = 0
for i in range(0, 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)

Solution (Python):
five_hund = int(input())
one_hund = int(input())
fifty = int(input())
X = int(input())
count = 0

for five in range(five_hund + 1):
  for one in range(one_hund + 1):
    for fif in range(fifty + 1):
      if(five * 500 + one * 100 + fif * 50 == X):
        count += 1
print(count)

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

Solution (Python):
def main():

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

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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))

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

Solution (Python):
list1 = []
cnt = 0
for i in range(4):
    list1.append(int(input()))
for i in range(list1[0]+1):
    for j in range(list1[1]+1):
        for k in range(list1[2]+1):
            if list1[3] == 500*i + 100*j + 50*k:
                cnt += 1
print(cnt)

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

Solution (Python):
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)

Solution (Python):
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)

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

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

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)

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

def func(a, b, c, x):
    count = 0
    for i in reversed(range(a)):
        y = 500 * i
        if x < y:
            continue
        elif x == y:
            count += 1
            continue
        for j in reversed(range(b)):
            y = 500 * i + 100 * j
            if x < y:
                continue
            elif x == y:
                count += 1
                continue
            for k in reversed(range(c)):
                y = 500 * i + 100 * j + 50 * k
                if x < y:
                    continue
                elif x == y:
                    count += 1
                    break
                else:
                    break
    return count

count = func(a+1, b+1, c+1, x)
print(count)

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

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

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

Solution (Python):
import itertools

A = range(int(input()) + 1)
B = range(int(input()) + 1)
C = range(int(input()) + 1)
X = int(input())

count = 0
for i in itertools.product(A, B, C):
  if i[0] * 500 + i[1] * 100 + i[2] * 50 == X:
    count += 1
print(count)

Solution (Python):
a,b,c,x=[int(input()) for _ in range(4)]
ans=0
if x<=500*a+100*b+50*c:
    r1=min(x//500,a)
    for i in range(r1+1):
        x0=x-500*i
        if x0<=100*b+50*c:
            r2=min(x0//100,b)
            for j in range(r2+1):
                x1=x0-100*j
                if x1%50==0 and 0<=x1//50<=c:
                    ans+=1
print(ans)

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

cnt = 0
money = 0

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

print(cnt)

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

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)

Solution (Python):
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)

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

N = (A + 1) * (B + 1) * (C + 1)
Total = [0 for i in range(N)]
l = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            Total[l] = 500*i + 100*j + 50*k
            l += 1

print(Total.count(X))

Solution (Python):
import sys
read_=sys.stdin.buffer.readline

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

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)

Solution (Python):
A=[0,0,0]
A[0]=int(input())
A[1]=int(input())
A[2]=int(input())
X=int(input())

ans=0
for i in range(A[0]+1):
    for j in range(A[1]+1):
        rem=X-500*i - 100*j
        CC=rem//50
        if CC>=0 and CC<=A[2]:
            ans+=1
            
print(ans)

Solution (Python):
a,b,c = [int(input()) for _ in range(3)] 
x = int(input())

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

print(z.count(x))

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

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

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

count = 0

for i in range(A + 1):
  temp = X - i*500
  if temp ==0:
    count = count + 1
    continue
  elif temp > 0:
    
    for j in range(B + 1):
      tempB = temp -j *100
      if temp == 0:
        count = count +1
        continue
      elif temp>0:
        
        for h in range(C + 1):
          tempC = tempB -h * 50
          if tempC == 0:
            count = count + 1
            continue
          else:
            continue
      else:
        continue
  else:
    continue
    
print(count)

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

count = 0

for i in range(A + 1):
    temp = X - i * 500
    if temp == 0:
        count = count + 1
        continue
    elif temp > 0:
        for j in range(B + 1):
            tempB = temp - j * 100
            if tempB == 0:
                count = count + 1
                continue
            elif tempB > 0:
                for k in range(C + 1):
                    tempC = tempB - k * 50
                    if tempC == 0:
                        count = count + 1
                        continue
                    else:
                        continue
            else:
                continue
    else:
        continue

print(count)