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:
result = 0
A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input()) 
 
for a in range(A):
    for b in range(B):
        for c in range(C):
          if 500*a + 100*b + 50*c == X:
            result += 1
 
print(result)

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for c in range(0, C+1):
    for b in range(0, B+1):
        for a in range(0, C+1):
            if c*50 + b*100 + a*500 == X:
                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 ia in range(0, min(round(x/500)+1,a+1)):
    y = x-500*ia
    for ib in range(0, min(round(y/100)+1, b+1)):
        z = y-100*ib
        if z%50 == 0 and z/50 <= c:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
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*a+100*b+50*c==n:
        count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
import sys
a = int(input())
b = int(input())
c = int(input())
n = int(input())

count = 0
if n<100:
  if c > 0:
    count = 1
  print(count)
  sys.exit()
elif n<500:
  for i in range(b+1):
    for j in range(c+1):
      if 100*b+50*c==n:
        count += 1
  print(count)
  sys.exit()

else:
  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:
          cout += 1
  print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input()) 
ans = 0
        
for ia in range(a):
    for ib in range(b):
        for ic in range(c):
            num = 500*ia+100*ib+50*ic
            if num==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 k in range(a):
    for l in range(b):
        for m in range(c):
            total = 500 * k + 100 * l + 50 * m
            if total == x:
                ans += 1

print(ans)

Submission status: Wrong Answer

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

count = 0

a = 0
while a <= A:
  b = 0
  while b <= B:
    r = X - 10*a - 2*b
    if r >= 0:
      count += min(r, C) + 1
    b += 1
  a += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

for num_a in range(1, a + 1):
  for num_b in range(1, b + 1):
    for num_c in range(1, c + 1):
      if 500 * num_a + 100 * num_b + 50 * num_c == x:
        ans += 1

print(ans)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

count = 0

for i in range(0, c):

    if (i * 50) > x:
        break

    for j in range(0, b):

        if ((j * 100) > x):
            break

        for k in range(0, a):
            result = (i * 50) + (j * 100) + (k * 500)

            if (result == x):
                count += 1

            if (k * 500) > x:
                break

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+1):
  for j in range(b+1):
    for k in range(c+1):
      t = i*500 + j*100 + k*50
      if t is x:
        ans = 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+1):
  for j in range(b+1):
    for k in range(c+1):
      tt = i*500 + j*100 + k*50
      if tt is x:
        ans +=1

print(ans)

Submission status: Wrong Answer

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

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

ans = sum([1 for i in t if i is x])
print(ans)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
XL = list(str(X))
hantei = False
count = 0

if XL[-2] == 5:
    for a in range(A + 1):
        for b in range(B + 1):
            for c in range(1, C + 1, 2):
                if (500*a)+(100*b)+(50*c) == X:
                    count += 1
else:
    for a in range(A + 1):
        for b in range(B + 1):
            for c in range(0, C + 1, 2):
                if (500*a)+(100*b)+(50*c) == X:
                    count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = int(input())

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


print(a)

Submission status: Wrong Answer

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

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

print(n_pattern)

Submission status: Wrong Answer

Solution code:
a = int(input(), 10)
b = int(input(), 10)
c = int(input(), 10)
x = int(input(), 10)
ptn = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

can_count = 0

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

print(can_count)

Submission status: Wrong Answer

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

can_count = 0

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

print(can_count)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
if a != 0:
    a = a+1
if b != 0:
    b = b+1
if c != 0:
    c = c+1
for i_a in range(a):
    for j_b in range(b):
        for k_c in range(c):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = count + 1
if a == b == c == 0:
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
if a != 0 and a != 50:
    a = a+1
if b != 0 and b != 50:
    b = b+1
if c != 0 and c != 50:
    c = c+1
for i_a in range(a):
    for j_b in range(b):
        for k_c in range(c):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = count + 1
if a == b == c == 0:
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
if a != 0:
    a = a+1
if b != 0:
    b = b+1
if c != 0:
    c = c+1
for i_a in range(a):
    for j_b in range(b):
        for k_c in range(c):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = 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("金額(50の倍数):"))
if ((A+B+C<1) or (A<0 or A>50) or (B<0 or B>50) or (C<0 or C>50) or (X<50 or X > 20000 or X%50!=0)):
    print("条件を満たしてください")
count = 0

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

print (count)

Submission status: Wrong Answer

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

number_of_combination = 0


for k in range(0,A+1):
    number_of_c = k
    for j in range(0,B+1):
        number_of_b = j
        for i in range(0,C+1):
            number_of_a = i
            sum = 500*number_of_a + 100*number_of_b + 50*number_of_c
            if sum == int(X):
                number_of_combination += 1

print(number_of_combination)

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(3):
    if l[i]!=0:
        l[i] += 1
for i in range(l[2]):
    b = 50 * i 
    if b == l[3]:
        a += 1
    for j in range(l[1]):
        b = 50 * i 
        b += 100 * j
        if b == l[3] and j != 0 :
            a += 1
        for k in range(1,l[0]):
            b = 50 * i + 100 * j 
            b += 500 * k 
            if b == l[3] :
                a += 1

                 
print('{}'.format(a))

Submission status: Wrong Answer

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

                 
print('{}'.format(a))

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(3):
    if l[i]!=0:
        l[i] += 1
for i in range(l[2]):
    b = 50 * i 
    if b == l[3]:
        a += 1
    for j in range(l[1]):
        b = 50 * i 
        b += 100 * j
        if b == l[3]:
            a += 1
        for k in range(1,l[0]):
            b = 50 * i + 100 * j 
            b += 500 * k 
            if b == l[3]:
                a += 1
           
print('{}'.format(a))

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(l[2]+1):
    b = 50 * i 
    if b == l[3]:
        a += 1
    for j in range(l[1]+1):
        b = 50 * i 
        b += 100 * j
        if b == l[3]:
            a += 1
        for k in range(1,l[0]+1):
            b = 50 * i + 100 * j 
            b += 500 * k 
            if b == l[3]:
                a += 1
           
print('{}'.format(a))

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(1,l[2]+1):
    b = 50 * i 
    if b == l[3]:
        a +=1
    for j in range(1,l[1]+1):
        b += 100 * j
        if b == l[3]:
            a += 1
        for k in range(1,l[2]+1):
            b += 500 * k 
            if b == l[3]:
                a += 1
for j in range(1,l[1]+1):
    b = 100 * j
    if b == l[3]:
        a += 1
    for k in range(1,l[2]+1):
        b += 500 * k 
        if b == l[3]:
            a += 1
for k in range(1,l[2]+1):
    b = 500 * k 
    if b == l[3]:
        a += 1
                
print('{}'.format(a))

Submission status: Wrong Answer

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

'''
A:500  = 10*50
B:100  = 2*50
C:50   = 1*50
'''

times = X//50
count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            #if(times%(10*i+2*j+k)==0):
            if(i==0 and j==0) and (j==0 and k==0):
                break
            print(i,j,k)
            if X/(500*i+100*j+50*k)==0.0:
                count = 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())

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

print(count)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())/50
#10a+2b+c=x
i=0
aam=int(x//10)
if aam > a:
    aam=a
for aa in range(aam+1):
    y=x-10*aa
    bbm=y//2

    if bbm > b:
        bbm=b
        #y-2bb>c NG
    if (y-c)/2<=0:
        i+=bbm+1

    else:
        i+=bbm-(y-c+2-1)//2+1

print(int(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for a_i in range(0, a + 1):
    if a_i * 500 > x:
        break
    for b_i in range(0, b + 1):
        for c_i in range(0, c + 1):
            print(a_i, b_i, c_i)
            if a_i * 500 + b_i * 100 + c_i * 50 == x:
                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 p in range(a):
  for q in range(b):
    for r in range(c):
      if p*500+q*100+r*50==x:
        result+=1
print(result)

Submission status: Wrong Answer

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

cnt = 0

for i in range(0, a):
	for j in range(0, b):
		for k in range(0, c):
			if x == 500 * i + 100 * j + 50 * k:
				cnt = 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):
    if x - (500 * i) >= 0:
        x_ = x - (500 * i)
        for j in range(b):
            if x_ - (100 * j) >= 0:
                x_ = x - (100 * j)
                for k in range(c):
                    if x_ - (50 * k) == 0:
                        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+1):
    for j in range(b+1):
        for l in range(c+1):
            if a*500+b*100+c*50==x:
                count+=1
print(count)

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 j in range(b+1):
        for k in range(c+1):
            if a * 500 + b * 100 + c * 50 == x:
                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+1):
 if 500*i>x: break
 for j in range(b+1):
  if 500*i+100*j > x: break
  if x-500*i-100*j <= 50*c: break
  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 i in range(a+1):
 if 500*i>x: break
 for j in range(b+1):
  if 500*i+100*j > x: break
  if x-500*i-100*j >= 50*c: break
  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 i in range(a+1):
 if 500*i>x: break
 for j in range(b+1):
  if 500*i+100*j > x: break
  if x-500*i-100*j > 50*c: break
  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 i in range(a+1):
 if 500*i>x: break
 for j in range(b+1):
  if x-500*i-100*j > 50*c: break
  count += 1

print(count)

Submission status: 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):
   if 500*i+100*j+50*k == x:
    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 i in range(a):
 for j in range(b):
  for k in range(c):
   if 500*a+100*b+50*c == x:
    count += 1

print(count)

Submission status: Wrong Answer

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

cand = [(i, j, k) for i in range(A) for j in range(B) for k in range(C)]
count = 0

for c in cand:
    if 500*c[0] + 100*c[1] + 50*c[2] == X:
        count += 1
        
print(count)

Submission status: Wrong Answer

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

cand = [(i, j, k) for i in range(50) for j in range(50) for k in range(50)]
count = 0

for c in cand:
    if 500*c[0] + 100*c[1] + 50*c[2] == X and c[0] <= A and c[1] <= B and c[2] <= C:
        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):
            tmp = i*500 + j*100 + k*50
            if tmp == x:
                ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x%500==0 and x%100==0:
    print((x//500)+(x//100)+1)
elif  x%500!=0 and x%100==0:
    print((x//100)+1)
else:
    print(1)

Submission status: Wrong Answer

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

if x%500==0:
    print((x//500)+(x//100)+1)
elif  x%500!=0 and x%100==0:
    print((x//100)+1)
else:
    print(1)

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

Submission status: Wrong Answer

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

count = 0
for a_n in range(a):
    for b_n in range(b):
        for c_n in range(c):
            if (a_n * 500) + (b_n * 100) + (c_n * 50) == x:
                count += 1
            else:
                continue

print(count)

Submission status: Wrong Answer

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

count = 0
for a_n in range(a):
    for b_n in range(b):
        for c_n in range(c):
            if x - (a_n * 500) - (b_n * 100) - (c_n * 50) is 0:
                count += 1
            else:
                continue

print(count)

Submission status: Wrong Answer

Solution code:
def B_Coins():
    A=int(input())
    B=int(input())
    C=int(input())
    X=int(input())
    count = 0
    
    for i in range(A):
        for j in range(B):
            y = (X-(500*i+100*j))/50
            if y >=0 and y <= C:
                count += 1
    print(count)

B_Coins()

Submission status: Wrong Answer

Solution code:
a, b, c, x = [int(input()) for _ in range(4)]
cnt = 0
for ai in range(1, a+1):
    for bi in range(1, b+1):
        for ci in range(1, c+1):
            if 500*ai + 100*bi + 50*ci == x:
                cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
a, b, c, x = [int(input()) for _ in range(4)]
cnt = 0
for ai in range(a):
    for bi in range(b):
        for ci in range(c):
            if 500*ai + 100*bi + 50*ci == x:
                cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
l,total,cnt = [500,]*input()+[100,]*input()+[10,]*input(), input(),0
for i in range(len(l)):
	for j in range(i+1,len(l)+1):
		if sum(l[i:j]) == total: cnt+=1
print cnt

Submission status: Wrong Answer

Solution code:
l,total,cnt = [500,]*input()+[100,]*input()+[10,]*input(), input(),0
for i in range(len(l)):
	for j in range(i,len(l)):
		if sum(l[i:j]) == total: cnt+=1
print cnt

Submission status: Wrong Answer

Solution code:
list,total = [500*input(),100*input(),10*input()], input()
cnt = 0
for i in range(len(list)):
    for j in range(1,len(list)):
        if sum(list[i:j]) == total: cnt+=1
print cnt

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = [int(input()) for i in range(4)]
#ABCX
count = 0
for i in range(l[2]+1):
    for j in range(l[1]+1):
        for k in range(l[0]+1):
            if (i*500+j*100+k*50)==l[3]:
                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 i in range(A+1):
 for j in range(B+1):
  reX = X - A*i - B*j;
  if 0<= reX <= 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 i in range(A+1):
 for j in range(B+1):
  reX =( X - A*i - B*j)
  if 0<= reX <= C:
   count+=1
print(count)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
l = 0
 
def pattern(a, b, c, x):
	if x == 0:
		return 1
	else:
		if (500 * a + 100 * b + 50 * c < x):
			return 0
		elif (x >= 500) and (a >= 1):
			return pattern(a - 1, b, c, x - 500) + pattern(0, b, c, x)
		elif (x >= 100) and (b >= 1):
			return pattern(a, b - 1, c, x - 100) + pattern(a, 0, c, x)
		elif (x >= 50) and (c >= 1):
			return pattern(a, b, c - 1, x - 50) + pattern(a, b, 0, x)
		else:
			return 0
 
ans = pattern(a, b, c, x)

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):
  reX = X - A*i - B*j;
  if 0<= reX <= C:
   count+=1

print(count)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
y=0
d=0
s=0
t=0
u=0
for i in range(a+1):
    t=0
    u=0
    if s==0: 
        y=500*i
        if x < y:
            s =1
        else:
            for j in range(b+1):
                u=0
                if t==0:
                    y=500*i+100*j
                    if x < y:
                        t=1
                    else:
                        for k in range(c+1):
                            if u==0:
                                y=500*i+100*j+50*k
                                if x==y:
                                    d=d+1
                                    u=1
                                    print(i,j,k)
print(str(d))

Submission status: Wrong Answer

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

A_list = list()
for i in range(A) :
    A_list.append(i*500)
B_list = list()
for i in range(B) :
    B_list.append(i*100)
C_list = list()
for i in range(C) :
    C_list.append(i*50)

count = 0
for a in A_list :
    for b in B_list :
        for c in C_list :
            if (a + b + c) == X :
                count += 1

print(count)

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
a = int(input())
b = int(input())
c = int(input())
x = int(input())

def combi(x, a, b):
    ans = 0
    b_num = []
    if a == 0 and b != 0:
        if x/b == 0:
            ans += 1
            b_num.append(x)
    elif a != 0 and b == 0:
        if x/a == 0:
            ans += 1
    elif a == 0 and b == 0:
        ans = 0
    else:
        for i in range(int(x/a)+1):
            if (x - i*a)%b == 0:
                ans += 1
                b_num.append(x - i*a)
    return ans, b_num
ans1, test = combi(x, a, b)
sum1 = 0
for i in range(len(test)):
    
    ans, val = combi(test[i], b, c)
    sum1 += ans

print(sum1)

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=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 = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
ca = int(x/500)
if(ca>a):
    ca = a
for i in range(ca+1):
    ax = x - 500*i
    cb = int(ax/100)
    for j in range(cb+1):
        if(j>b):
            break
        bx = ax - 100*j
        cc = int(bx/50)
        if(cc>c):
            break
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
def countSol(coeff, start, end, rhs, a):
	if (rhs == 0):
		return 1
	result = 0
	for I in range(start,end+1):
		if (coeff[I]<=rhs and a[I]>0):
			a[I]-=1
			result+=countSol(coeff, I, end, rhs - coeff[I],a)
	return result 
A=int(input())
B=int(input())
C=int(input())
X=int(input())
D=[A,B,C]
print(countSol([500,100,50],0,2,X,D))

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):
    if i*500 <= x:
        for k in range(b+1):
            if k*100 <= (x-i*500):
                if (x-i*500-k*100)/50 <= c:
                    print(i,k,(x-i*500-k*100)/50)
                    ans += 1
print(ans)