Problem:


Score : 200 points

Problem Statement

You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?

Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Constraints

0 \leq A, B, C \leq 50

A + B + C \geq 1

50 \leq X \leq 20 000

A, B and C are integers.

X is a multiple of 50.

Input

Input is given from Standard Input in the following format:

A
B
C
X

Output

Print the number of ways to select coins.

Sample Input 1

2
2
2
100

Sample Output 1

2

There are two ways to satisfy the condition:

Select zero 500-yen coins, one 100-yen coin and zero 50-yen coins.

Select zero 500-yen coins, zero 100-yen coins and two 50-yen coins.

Sample Input 2

5
1
0
150

Sample Output 2

0

Note that the total must be exactly X yen.

Sample Input 3

30
40
50
6000

Sample Output 3

213



Sample input:
2
2
2
100


Sample output:
2

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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


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

print(count)

Submission status: Accepted

Solution code:
A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input()) #target

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)
print(z.count(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
A = int(input())#500
B = int(input())#100
C = int(input())#50
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)

Submission status: Accepted

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


def calc(val):
    pass
def main():
    cnt = 0
    ans = 0
    for i in range(C+1):
        ans_C = X - i*50
        if ans_C == 0:
            cnt+=1
            break
        elif ans_C < 0:
            break
        else:
            pass

        for j in range(B+1):
            ans_B = ans_C - j*100
            if ans_B == 0:
                cnt+=1
                break
            elif ans_B < 0:
                break
            else:
                pass

            for k in range(A+1):
                ans_A = ans_B - k*500
                if ans_A == 0:
                    cnt+=1
                    break
                elif ans_A < 0:
                    break
                else:
                    pass
    
    print(cnt)

                
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
a_ = X//500
if a_>A:
    a_ = A
for a in range(a_+1):
    x_ = X-a*500
    b_ = x_//100
    if b_>B:
        b_ = B
    for b in range(b_+1):
        x = x_-b*100
        c_ = x//50
        if c_<=C and c_>=0:
            count = count + 1

print(count)

Submission status: Accepted

Solution code:
def solve():
    x, y, z, n = [int(input()) for _ in range(4)]
    ans = 0
    for i in range(x+1):
        for j in range(y+1):
            for k in range(z+1):
                if 500 * i + 100 * j + 50 * k == n:
                    ans += 1
    return ans

print(solve())

Submission status: Accepted

Solution code:
def main():
    A = int(input())
    B = int(input())
    C = int(input())
    target = int(input())
    answer = 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 == target:
                    answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b
# 2020/02/15
import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
lst=[]
A=int(input())
B=int(input())
C=int(input())
X=int(input())//50
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 10*a+2*b+c==X:
                lst.append([a,b,c])
print(len(lst))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())  # 500 - 10
B = int(input())  # 100 - 2
C = int(input())  # 50 - 1
X = int(input())

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

Submission status: Accepted

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

for x in range(0, A+1):
  for y in range(0, B+1):
    for z in range(0, C+1):
      if x*500 + y*100 + z*50 == X:
        count +=1
      
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
total = 0
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+50*k
            if total == x:
                cnt += 1
print(cnt)

Submission status: Accepted

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

cnt = 0
for ia in range(A+1):
    for ib in range(B+1):
        for ic in range(C+1):
            if 500*ia+100*ib+50*ic == X:
                cnt = cnt + 1

print(cnt)

Submission status: Accepted

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

X = int(input())

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


print(count)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import  numpy

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

lisA=list(range(A+1))
lisB=list(range(B+1))
lisC=list(range(C+1))

vA=numpy.repeat(lisA, len(lisB)*len(lisC))
vB=numpy.repeat(len(lisA)*lisB, len(lisC))
vC=numpy.repeat(len(lisA)*len(lisB)*lisC,1)


O = numpy.matrix([500,100,50])
P = numpy.array([vA,vB,vC]).reshape(3,len(vA))
Q = O*P
ans=numpy.sum(Q==X)

print(ans)

Submission status: Accepted

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

ans = 0

# 全文のforで検索可能

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

print(ans)

Submission status: Accepted

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

ans = 0
for a in range(A+1):
    tmp_a = X - a * 500
    if tmp_a == 0:
        ans += 1
        continue
    elif tmp_a < 0:
        break
    else:
        for b in range(B+1):
            tmp_b = tmp_a - b * 100
            if tmp_b == 0:
                ans += 1
                continue
            elif tmp_b < 0:
                break
            else:
                for c in range(C+1):
                    tmp_c = tmp_b - c * 50
                    if tmp_c == 0:
                        ans += 1
                        continue
                    elif tmp_b < 0:
                        break

print(ans)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for 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
      else:
        pass
print(count)

Submission status: Accepted

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

Submission status: Accepted

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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力 : 数字4つ、別々に
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) :
            total = 500 * a + 100 * b + 50 * c
            if total == X :
                ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
num=0
for aa in range(a+1):
  for bb in range(b+1):
    for cc in range(c+1):
      total = 500*aa+ 100*bb+50*cc
#      print(aa,bb,cc,"total",total,"x",x)
      if total == x:
        num += 1
print(num)

Submission status: Accepted

Solution code:

def main(a,b,c,x):
    count = 0
    #各硬化を何枚選ぶか全探索
    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                p = (500*i) + (100*j) + (50*k)
                if p == x:
                    count += 1
    return count

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

Submission status: Accepted

Solution code:
a,b,c,x = [int(input())+1 for _ in range(4)]
print(sum(10*i+2*j+k==x//50 for i in range(a) for j in range(b) for k in range(c)))

Submission status: Accepted

Solution code:
a = int(input());b = int(input());c = int(input());x = int(input())
s = 0
counter = 0

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

print(counter)

Submission status: Accepted

Solution code:
a = int(input());b = int(input());c = int(input());x = int(input())
s = 0
n = 0
counter = 0

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

print(counter)

Submission status: Accepted

Solution code:
[A, B, C, X] = list(map(int, [input() for i in range(4)]))
count = 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:
        count += 1

print(count)

Submission status: Accepted

Solution code:
A = int(input())  # 500円玉の枚数
B = int(input())  # 100円玉の枚数
C = int(input())  # 50円玉の枚数
X = int(input())  # 合計X円にしたい

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

Submission status: Accepted

Solution code:
a,b,c,x = [int(input())+1 for _ in range(4)]
print(sum(10*i+2*j+k==x//50 for k in range(c) for j in range(b) for i in range(a)))

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
for i500 in range(a+1):
    for i100 in range(b+1):
        for i_50 in range(c+1):
            if x==500*i500+100*i100+50*i_50:
                cnt+=1
            elif x<500*i500+100*i100+50*i_50:break
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for an in range(a+1):
    for bn in range(b+1):
        for cn in range(c+1):
            if 500*an + 100*bn + 50 * cn == x:
                ans += 1

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for p in range(a + 1):
    for q in range(b + 1):
        r = (x - p * 500 - q * 100) // 50
        if 0 <= r <= c:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
d=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:
                d+=1
            else:
                continue
    #if i==a-1:
print(d)
    #else:
        #pass

Submission status: Accepted

Solution code:
A_500 = int(input())
B_100 = int(input())
C_50 = int(input())
X = int(input())

count = 0

for i in range(0, A_500 + 1):
	for j in range(0, B_100 + 1):
		for k in range(0, C_50 + 1):
			if X == i * 500 + j * 100 + k * 50:
				count += 1

print(count)

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(a+1):
    oturi = x-500*i
    if oturi < 0:
        break
    else:
        for j in range(b+1):
            oturi_2 = oturi-100*j
            if oturi_2 < 0:
                break
            else:
                if oturi_2 // 50 <= c:
                    counter += 1
print(counter)

Submission status: Accepted

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

for i in range(a+1):
    oturi = x-500*i
    if oturi < 0:
        continue
    else:
        for j in range(b+1):
            oturi_2 = oturi-100*j
            if oturi_2 < 0:
                continue
            else:
                if oturi_2 // 50 <= c:
                    counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(4)]
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*k == l[3]:
                count += 1
print(count)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    A=INT()
    B=INT()
    C=INT()
    x=INT()
    ct=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:
                    ct+=1
    print(ct)
    
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

Solution code:
a_num = int(input())
b_num = int(input())
c_num = int(input())
x = int(input())

total = []

for a in range(0, a_num+1):
  for b in range(0, b_num+1):
    for c in range(0, c_num+1):
      total.append(a*500+b*100+c*50)

print(total.count(x))

Submission status: Accepted

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

ans = 0
a = X // 500
b = X // 100
c = X // 50
xflag = False
yflag = False
zflag = False
for i in range(a+1):
    x = 500*i
    if i > A:
        continue
    for j in range(b+1):
        y = 100*j
        if j > B:
            continue
        for k in range(c+1):
            z = 50*k
            if k > C:
                continue
            s = x+y+z
            if s==X:
                ans += 1
print(ans)