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: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
X = int(input())

_500 = 500
_100 = 100
_50 = 50

count = 0

if A > 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) == 0:
                    count = count + 1
else:
    if B > 0:
        for b in range(B+1):
            for c in range(C+1):
                if X - (b*_100 + c*_50) == 0:
                    count = count + 1
    else:
        for c in range(C+1):
            if X - (C*_50) == 0:
                count = count + 1

print(count)

Submission status: Wrong Answer

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

max_a = a if total // 500 > a else total // 500
max_b = b if total // 100 > b else total // 100
max_c = c if total // 50 > c else total // 50
ans = 0
for i in range(0, max_a + 1):
  for j in range(0, max_b + 1):
    for k in range(0, max_c + 1):
      print(i, j, k)
      sum = 500 * i + 100 * j + 50 * k
      if (sum == total) :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

max_a = a if total // 500 > a else total // 500
max_b = b if total // 100 > b else total // 100
max_c = c if total // 50 > c else total // 50
print(max_a, max_b, max_c)
ans = 0
for i in range(0, max_a + 1):
  for j in range(0, max_b + 1):
    for k in range(0, max_c + 1):
      sum = 500 * i + 100 * j + 50 * k
      if (sum == total) :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

max_a = total // 500
max_b = total // 100
max_c = total // 50
ans = 0
for i in range(0, max_a):
  for j in range(0, max_b):
    for k in range(0, max_c):
      sum = 500 * i + 100 * j + 50 * k
      if (sum == total) :
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
n = int(x/500)
if n>a:
    n = a
for i in range(n+1):
    y = x - 500*i
    m = int(y/100)
    if m>b:
        m = b
    for j in range(m+1):
        z = y - 100*j
        if z % 50 or z/50 > c:
            break
        else:
            count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
n = int(x/500)
if n>a:
    n = a
for i in range(n+1):
    y = x - 500*i
    m = int(y/100)
    if m>b:
        m = b
    for j in range(m+1):
        z = y - 100*j
        if z % 50 or z/50 > c:
            print(0)
            break
        else:
            count += 1
print(count)

Submission status: Wrong Answer

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

result = 0

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

print(result)

Submission status: Wrong Answer

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

result = 0

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

print(result)

Submission status: Wrong Answer

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

result = 0

sum = 0

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

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
c=0
count = 0
while a*500<=X and a<=A:
    while a*500+b*100<=X and b<=B:
        while a*500+b*100+c * 50 <=X and c<=C:
            if b*100+c*50==X:
                #print(a,b,c)
                count+=1
                break
            else:
                #print(b,c)
                c+=1
        c=0
        b+=1
        #print(b,c)
    a+=1
    b=0
    c=0
print(count)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
c=0
count = 0
while a*500<=X and a<=A:
    while a*500+b*100<=X and b<=B:
        while a*500+b*100+c * 50 <=X and c<=C:
            if b*100+c*50==X:
                print(a,b,c)
                count+=1
                break
            else:
                #print(b,c)
                c+=1
        c=0
        b+=1
        #print(b,c)
    a+=1
    b=0
    c=0
print(count)

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
c=0
count = 0
while a*500<=X:
    while b*100<=X:
        while b*100+c * 50 <=X:
            if b*100+c*50==X:
                #print(a,b,c)
                count+=1
                break
            else:
                #print(b,c)
                c+=1
        c=0
        b+=1
        #print(b,c)
    a+=1
    b=0
    c=0
'''
while a * 500 <=X and a < A:
    while a * 500+ b * 100 <= X and b < B:
        while a * 500 + b * 100 + c * 50 <= X and c < C:
            if(a * 500 + b * 100 + c * 50 == X):
                count+=1
                c=0
                break
            elif(a * 500 + b * 100 + c * 50 >X):
                break
            else:
                print(c)
                c+=1
        b+=1
    a+=1
'''
print(count)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()

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

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

print(cnt)

Submission status: Wrong Answer

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

count = 0

task1 = (x // 500) if (x // 500) < a else a
for i in range(task1 + 1):
    new_x = x - 500 * i
    task2 = (new_x // 100) if (new_x // 500) < b else b
    for i in range(task2 + 1):
        y = new_x - 100 * i
        if y <= 50 * c:
            count += 1
print(count)

Submission status: Wrong Answer

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 += 0


print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

X //= 10
ans = 0
for a in range(A+1):
    tmp = 50*a
    if tmp > X:
        break
    for b in range(B+1):
        tmp += 10*b
        if tmp > X:
            break
        else:
            r = X-tmp
            if r % 5 == 0 and r//5 <= C:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
if 50>A>0 and 50>B>0 and 50>C>0 and (A+B+C)>1 and 50<X<20000 and X%50==0:
  for i in range(A+1):
    for j in range(B+1):
      for k in range(C+1):
        if 500*i + 100*j + 50*k == X:
          res += 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s1, s2, s3, total =[int(input()) for h in range(4)]
ans = 0
for i in range(s1+1):
    for j in range(s2+1):
        for k in range(s3+1):
            if 500*s1 + 100*s2 + 50*s3 == total:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

if X % 50:
    print(k)
else:
    maxA = min(X // 500, A)
    for i in range(maxA + 1):
        d = X - 500 * i
        maxB = min(d // 100, B)
        for j in range(maxB + 1):
            d = d - 100 * j
            if d // 50 <= C:
                k += 1
    print(k)

Submission status: Wrong Answer

Solution code:
a,b,c,x=[int(input())+1for _ in[0]*4];print(sum(c>x/50-I//b*10>I%b*2for I in range(a*b)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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*a+100*b+50*c==x:
                ans += 1
print(ans)

Submission status: Wrong Answer

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):
            if 500*a+100*b+50*c==x:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

num = 0
for i in range(0,A+1):
    for ii in range(0,B+1):
        for iii in range(0,C+1):
            t = i*500 + ii*100 + iii*50
            print(t)
            if t ==X:
                num+=1
print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a_500 = int(input().split()[0])
b_100 = int(input().split()[0])
c_50 = int(input().split()[0])
x = int(input().split()[0])

all_coins = []
count = 0

for a_n in range(a_500+1):
    for b_n in range(b_100+1):
        for c_n in range(c_50+1):
            hoge = 500*a_n + 100*b_n + 50*c_50
            if hoge == x:
                count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
X = int(input())
fifty = [x for x in range (0,X+1,500)][:a+1]
hundred = [x for x in range (0,X+1,100)][:b+1]
five_hundred = [x for x in range (0,X+1,50)][:c+1]
pattern = [x+y+z for x in fifty for y in hundred for z in five_hundred]
pattern
len(list(filter(lambda x:x==X,pattern)))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
X = int(input())
fifty = [x for x in range (0,X+1,500)][:a+1]
hundred = [x for x in range (0,X+1,100)][:b+1]
five_hundred = [x for x in range (0,X+1,50)][:c+1]
pattern = [x+y+z for x in fifty for y in hundred for z in five_hundred]
len(list((filter(lambda x:x==X,pattern))))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
X = int(input())
fifty = [x for x in range (0,X+1,50)][:a+1]
hundred = [x for x in range (0,X+1,100)][:b+1]
five_hundred = [x for x in range (0,X+1,500)][:c+1]
pattern = [x+y+z for x in fifty for y in hundred for z in five_hundred]
len(list((filter(lambda x:x==X,pattern))))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
X = int(input())
fifty = [x for x in range (0,X+1,50)][:a+1]
hundred = [x for x in range (0,X+1,100)][:b+1]
five_hundred = [x for x in range (0,X+1,500)][:c+1]
pattern = [x+y+z for x in fifty for y in hundred for z in five_hundred]
print(len(list((filter(lambda x:x==X,pattern)))))

Submission status: Wrong Answer

Solution code:
_ = input()
_ = input()
_ = input()
X =int(input())
pattern = [x+y+z for z in range(0,X+1,50) for y in range(0,X+1,100) for x in range(0,X+1,500)]
len(list(filter(lambda x:x==X,pattern)))

Submission status: Wrong Answer

Solution code:
X =int(input())

pattern = [x+y+z for z in range(0,X+1,50) for y in range(0,X+1,100) for x in range(0,X+1,500)]
print(len(list(filter(lambda x:x==X,pattern))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(c)

Submission status: Wrong Answer

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

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

print(c)

Submission status: Wrong Answer

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

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

print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input("A=")
b = input("B=")
c = input("C=")
x = input("X=")

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

counter = 0
result = 0

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

print(counter)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

A,B,C,X = map(int, [A,B,C,X])

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
info = [int(input()) for _ in range(4)]
ans = 0
for i in range(info[0]):
  for j in range(info[1]):
    k = (info[3] - (500*i + 100*j)) // 50
    if 0 <= k <= info[2]:
      ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
ma = x // 500
mb = x // 100
mc = x // 50
na = min([a, ma])
nb = min([b, mb])
nc = min([c, mc])
for i500 in range(na+1):
  for i100 in range(nb+1):
      current = x-500*i500-100*i100
      if current >= 0 and x-current <= 50*nc:
          cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
ma = x // 500
mb = x // 100
mc = x // 50
na = min([a, ma])
nb = min([b, mb])
nc = min([c, mc])
for i500 in range(na+1):
  for i100 in range(nb+1):
      if x-500*i500-100*i100 <= 50*nc:
          cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 x == 500*a + 100*b + 50*c:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

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

    return a[0]


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

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

Submission status: Wrong Answer

Solution code:
import sys

a = int(input())
b = int(input())
c = int(input())
d = int(input())
count =0

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

Submission status: Wrong Answer

Solution code:
import sys

a = int(input())
b = int(input())
c = int(input())
d = int(input())
count =0

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

Submission status: Wrong Answer

Solution code:
import sys

a = int(input())
b = int(input())
c = int(input())
d = int(input())
count =0

for i in range(a):
	if (i*100==d):
		count = count + 1
		break
	if (i*100 > d):
		break
	
	for j in range(b):
		if (j*10==d):
			count = count + 1
			break
		if (i*100+j*10==d):
			count = count + 1
			break
		if (i*10+j*10 > d):
			break
		
		for k in range(c):
			if (k==d):
				count = count + 1
				break
			if (i*100+10*j+k==d):
				count = count + 1
				break
			if (i*100+10*j+k > d):
				break
	
	print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C, X = int(input()), int(input()), int(input()), int(input())
cnt = 0
try:
    for n_500 in range(min(X // A, A) + 1):
        for n_100 in range(min(X // B, B) + 1):
            for n_50 in range(min(X // C, C) + 1):
                if n_500 * 500 + n_100 * 100 + n_50 * 50 == X:
                    cnt += 1
except:
    pass

finally:
    print(cnt)

Submission status: Wrong Answer

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

for i in range(min(int(X/500)+1, A)):
    for n in range(min(int((X-500*i)/100)+1, B)):
        if C >= int((X-500*i-100*n)/50):
            count += 1
    

print(count)

Submission status: Wrong Answer

Solution code:
a = int(input()) #500
b = int(input()) #100
c = int(input()) #50
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:
                print("cnt!")
                cnt += 1

print(cnt)

Submission status: Wrong Answer

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

res = 0

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

Submission status: Wrong Answer

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*b + 50*c == x:
                cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
a=0
b=0
Counter=0
while a<=A:
  while b<=B:
    if 0<=X-500*a-100*b<=50*C:
      Counter+=1
    b+=1
  a+=1
print(Counter)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
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):
      if (500*a)+(100*b)+(50*c) == x:
        res += 1

print(res)

Submission status: Wrong Answer

Solution code:
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):
      if (500*a)+(100*b)+(50*c) == x:
        res += 1
else:
  print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
all = []

for i in range(4):
    all.append(input())
    
a, b, c  = all[:-1]

X = all[-1]

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

Submission status: Wrong Answer

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

cnt = 0

a1 = x//500
b1 = x//100

for i in range(a1+1):
    x1 = x+1-1
    x1 -= 500*i
    for j in range(b1+1):
        x2 = x1+1-1
        x2 -= 100*j
        if x2 <= 50*c and x2 >=0:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0

a1 = x//500
b1 = x//100

for i in range(a1+1):
    x1 = x+0
    x1 -= 500*i
    for j in range(b1+1):
        x2 = x1+0
        x2 -= 100*j
        if x2 <= 50*c and x2 >=0:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0

a1 = x//500
b1 = x//100

for i in range(a1+1):
    x1 = x+0
    x1 -= 500*i
    for j in range(b1+1):
        x2 = x1+0
        x2 -= 100*j
        if x1 <= 50*c and x1 >=0:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0

a1 = x//500
b1 = x//100

for i in range(a1+1):
    x1 = x+0
    x1 -= 500*i
    for j in range(b1+1):
        x2 = x1+0
        x2 -= 100*j
        if x1 <= 50*c:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0

a1 = x//500
a2 = x%500
b1 = x//100
b2 = x%100
c1 = x//50
c2 = x%50

for i in range(a1+1):
    x1 = x+0
    x1 -= 500*i
    for j in range(b1+1):
        x1 -= 100*j
        if x1 <= 50*c:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
# import comb

def comb(n, k):
    m = 1
    # if n < 2 * k:
        # k = n - k
    for i in range(1, k + 1):
        m = m * (n - i + 1) / i    
    return m



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

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

if A == 0:
	Max_A = 0

else:
	Max_A = X // 10


counter = 0
# H = 0

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

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

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


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