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

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

print(count)

Submission status: Wrong Answer

Solution code:

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

    count = 0

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

    return count

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

if __name__ == '__main__':
    main()

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):
    n = i * 500
    if n == X:
        count += 1
        break
    for i in range(B):
        n = i * 100
        if n == X:
            count += 1
            break
        for i in range(C):
            n = i * 50
            if n == X:
                count += 1
                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):
      if i*500+j*100*k*50 == x:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#087_B
a,b,c,x=[int(input()) for i in range(4)]
print(sum([500*p+100*q+10*r==x for p in range(a+1) for q in range(b+1) for r in range(c+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 500*i + 100*j + 50*k == x:
                count += 1
print(int(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(count)

Submission status: Wrong Answer

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

m=x//500
n=(x-500*m)//100
way=0
while not m==0:
  way=way+n
  m-=1
  n+=5
print (way)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
C = int(input())
B = int(input())
A = int(input())
X = int(input())
Am =X
ans = 0
def coin(A,B,C,Am):
    global ans
    if Am ==0:
        ans += 1

    if Am ==50:
        if A > 0:
            ans += 1     
    if 50 < Am < 500:
        if A >0:
            coin(A-1,B,C,Am-50)
        if B >0:
            coin(A,B-1,C,Am-100)
        
    if Am > 500:
        if A >0:
            coin(A-1,B,C,Am-50)
        if B >0:
            coin(A,B-1,C,Am-100)
        if C >0:
            coin(A,B,C-1,Am-500)

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

print(c)

Submission status: Wrong Answer

Solution code:
five = int(input())
one_hundred = int(input())
fifty = int(input())
total = int(input())
count = 0
x = total//50
if 0<= x <=fifty:
  if 0 <= x//2 <= one_hundred:
    if 0 <= x//10 <= five:
      count = ( 1 + (x//2 + 1) + (x//10 + 1))
    else:
      count = ( 1 + (x//2 + 1) + five)
  else:
    count = (1 + one_hundred + five)
else:
  count = (fifty + one_hundred + five)
print(count)

Submission status: Wrong Answer

Solution code:
import  numpy

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

vA=list(range(A+1))*(B+1)*(C+1)
vB=list(range(B+1))*(A+1)*(C+1)
vC=list(range(C+1))*(A+1)*(B+1)
Com=len(vA)


O = numpy.matrix([500,100,50])
P = numpy.matrix(vA+vB+vC).reshape(3,Com)#枚数の組み合わせ
Q = O*P
ans=numpy.sum(Q==X)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

for a in range(0,A):
  for b in range(0,B):
    for c in range(0,C):
      if a+b+c == X:
        cnt +=1

print(cnt)

Submission status: Wrong Answer

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

cnt = 0

for a in range(0,A):
  for b in range(0,B):
    for c in range(0,C):
      if a+b+c == X:
        cnt +=1

Submission status: Wrong Answer

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):
  for j in range(b):
    for k in range(c):
      s = 500*i + 100*j + 50*k
      if s == x:
        counter += 1
      
for s in range(c):
  for t in range(b):
    for u in range(a):
      n = 50*s + 100*t + 500*u
      if n == x:
        counter += 1
        
print(counter)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
l=x//50
m=x//100
n=x//500
ans=0
for i in range(n+1):
  for j in range(m+1):
    for k in range(l+1):
      if l*50 + m*100 + n*500 == 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 p in range(a + 1):
    for q in range(b + 1):
        r = (x - p * 500 - q * 100) // 50
        if r <= c:
            ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# A == 10
# B == 2
# C == 1
#最後に50倍

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

Submission status: Wrong Answer

Solution code:
# A == 10
# B == 2
# C == 1
#最後に50倍

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

x = x / 50
count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            total = a *10 + b *2 + c
            if total == x:
                count += 1
                
if a == b == c == 0:
    print(0)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
# A == 10
# B == 2
# C == 1
#最後に50倍

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

x = x / 50
count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if a + b + c == x:
                count += 1
                
if a == b == c == 0:
    print(0)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
# A == 10
# B == 2
# C == 1
#最後に50倍

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

x = x / 50
count = 0

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

Submission status: Wrong Answer

Solution code:
# A == 10
# B == 2
# C == 1
#最後に50倍

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

x = x / 50
count = 0

for h in range(a +1):
    for i in range(b +1):
        for j in range(c +1):
            if a + b + c == x:
                count += 1

Submission status: Wrong Answer

Solution code:
count = 0

def check(a,b,c,n):
    if n==0:
        global count
        count += 1
        return
    if n<0:
        return
    if a>0:
        check(a-1,b,c,n-500)
    if b>0:
        check(a,b-1,c,n-100)
    if c>0:
        check(a,b,c-1,n-50)
    return



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

check(a,b,c,x)

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve(a, b, c, x):
    return sum(
        x == 500 * i + 100 * j + 50 * k
        for i in range(1, a + 1) # 500円
        for j in range(1, b + 1) # 100円
        for k in range(1, c + 1) # 50円
    )

_a = int(input())
_b = int(input())
_c = int(input())
_x = int(input())
print(solve(_a, _b, _c, _x))

Submission status: Wrong Answer

Solution code:
def solve(a, b, c, x):
    count_all_50yen = x // 50 # 50
    count_50yen_pattern = min(c, count_all_50yen)
    count_100yen_pattern = min(b, count_all_50yen // 2) # 100円を使用するパターン分だけ追加
    count_500yen_pattern = min(a, count_all_50yen // 10) # 500円を使用するパターン分だけ追加
    return count_50yen_pattern + count_100yen_pattern + count_500yen_pattern

_a = int(input())
_b = int(input())
_c = int(input())
_x = int(input())
print(solve(_a, _b, _c, _x))

Submission status: Wrong Answer

Solution code:
def solve(a, b, c, x):
    count_all_50yen = x // 50 # 50
    print(count_all_50yen)
    count_50yen_pattern = min(c, count_all_50yen)
    count_100yen_pattern = min(b, count_all_50yen // 2) # 100円を使用するパターン分だけ追加
    count_500yen_pattern = min(a, count_all_50yen // 10) # 500円を使用するパターン分だけ追加
    print(count_50yen_pattern, count_100yen_pattern, count_500yen_pattern)
    return count_50yen_pattern + count_100yen_pattern + count_500yen_pattern

_a = int(input())
_b = int(input())
_c = int(input())
_x = int(input())
print(solve(_a, _b, _c, _x))

Submission status: Wrong Answer

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

# 合計値
x = 0

# 組み合わせパターン
count = 0

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

count = 0

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

Submission status: Wrong Answer

Solution code:
n = input()
A = list(map(int, input().split()))
ans = 0
while not any (a%2 for a in A):
    ans+=1
    A = [a/2 for a in A]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
a = 0
b = 0

for i in range(min(C, int(X/500)) + 1):
    a = X - 500 * i
    for j in range(min(B, int(a/100)) + 1):
        b = a - 100 * j
        if int(b/50) <= C:
            count += 1
        else:
            pass

print(count)

Submission status: Wrong Answer

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

count = 0
a = 0
b = 0

for i in range(min(C, int(X/500)) + 1):
    a = X - 500 * i
    for j in range(min(B, int(a/100)) + 1):
        b = a - 100 * j
        if int(b/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
x = 0
for i in range(min(C, int(X/500)) + 1):
    x = X - 500 * i
    for j in range(min(B, int(x/100)) + 1):
        x -= 100 * j
        if int(x/50) <= C:
            count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
value=[input().rstrip() for i in range(4)]
value=list(map(int,value))
#print(value)
a=value[3]
answer=0
for i in range(0,value[0]+1):
    fake=a-500*i
    if fake==0:
        answer+=1
        break
    else:
        for j in range(0,value[1]+1):
            if j>0:
                fake=fake-100
            if fake==0:
                answer+=1
                #print(str(j)+'!')
            elif fake>0 and fake<=50*value[2]:
                answer+=1
# print(str(answer)+'!')

if a<=50*value[2]:
    answer+=1
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import functools

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

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

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

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

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

Submission status: Wrong Answer

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

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

print(N)

Submission status: Wrong Answer

Solution code:
num500 = int(input())
num100 = int(input())
num50 = int(input())
amount = int(input())
rst = 0
for itr500 in range(num500+1):
    for itr100 in range(num100+1):
        for itr50 in range(num50+1):
            kingaku = itr50*50+itr100*100+itr500*500
            print("itersは50¥", itr50, "100¥", itr100, "500¥", itr500)
            print(kingaku)
            if(kingaku==amount):
                rst += 1
print(rst)

Submission status: Wrong Answer

Solution code:
num50 = int(input())
num100 = int(input())
num500 = int(input())
amount = int(input())
rst = 0
for itr50 in range(num50+1):
    for itr100 in range(num100+1):
        for itr500 in range(num500+1):
            kingaku = itr50*50+itr100*100+itr500*500
            if(kingaku==amount):
                rst += 1
print(rst)

Submission status: Wrong Answer

Solution code:
num50 = int(input())
num100 = int(input())
num500 = int(input())
amount = int(input())
rst = 0
for itr50 in range(num50):
    for itr100 in range(num100):
        for itr500 in range(num500):
            kingaku = itr50*50+itr100*100+itr500*500
            if(kingaku==amount):
                rst += 1
print(rst)

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 n in range(B):
        for m in range(C):
            if i*500+n*100+m*50==X:
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a,b,c,x=[int(input()) for i in range(4)]
i=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:
                i+=1
print(i)

Submission status: Wrong Answer

Solution code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())

def coin_check(coin_total, total):
    if coin_total==total:
        return 1
    else:
        return 0

count = 0
for i in range(coin_500 + 1):
    coin_total = i*500
    count+=coin_check(coin_total, total)
    for j in range(coin_100 + 1):
        coin_total = i*500 + j*100
        count+=coin_check(coin_total, total)
        for k in range(coin_50 + 1):
            coin_total = i*500 + j*100 + k*50
            count+=coin_check(coin_total, total)
print(count)

Submission status: Wrong Answer

Solution code:
a,b,c,x=map(int,open(0).read().split())
cnt=0
#O(n**3)=O(50**3)=O(125000)
for i in range(a):
  for j in range(b):
    for k in range(c):
      if 500*i+100*j+50*k==x:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#初期値
able_number=0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
li = [int(input()) for i in range(4)]
counter = 0
for p in range(li[0]+1):
  for q in range(li[1]+1):
    for r in range(li[2]+1):
      if 500*p+100*q+r == li[3]:
        counter+=1
print(counter)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
 
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
cnt = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      p = i * 500 + j * 100 + k * 50
      if p > x:
        break
      if p == x:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

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

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+1):
  for j in range(b+1):
    for k in range(c+1):
      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())
# print(a, b, c, x)

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

input()
A = np.array(list(map(int, input().split())))

ans = 0
while(all(A%2==0)):
    A = A/2
    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 K in range(C+1):
            if A*500 + B*100 + C*50 == X:
                count += 1

print(count)

Submission status: Wrong Answer

Solution code:
#枚数初期設定
a_num = 0
b_num = 0
c_num = 0

#500円玉
a = 500
#100円玉
b = 100
#50円玉
c = 50

#正解カウンタ
ans = 0

#入力
x = int(input())

for i in range(50):
    for j in range(50):
        for k in range(50):
            try :
                x / (i * a_num  * a + j * b_num * b + k * c_num * c)
                ans += 1
            except ZeroDivisionError:
                print('だめだね')



print(ans)

Submission status: Wrong Answer

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

print(s)

Submission status: Wrong Answer

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

print(s)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
import itertools

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

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

print(count)

Submission status: 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 i in range(4)]

counter = 0

for i in range(0, A):
    for j in range(0, B):
        remain_num = X - (i * 500 + j * 100)
        divisible = (remain_num % 50 == 0)

        if divisible and (remain_num / 50) > 0:
            counter += 1

print(counter)

Submission status: Wrong Answer

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

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

print(counter)

Submission status: Wrong Answer

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

cnt = 0

for num_A in [num_A for num_A in range(A + 1) if (num_A * 500 <= X)]:
    rest_XA = X - num_A * 500
    for num_B in [num_B for num_B in range(B + 1) if num_B * 500 <= rest_XA]:
        rest_XAB = rest_XA - num_B * 100
        if rest_XAB % 50 == 0 and rest_XAB <= C * 50:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0

num_A = 0
while num_A * 500 <= X:
    rest_XA = X - num_A * 500
    num_B = 0
    while num_B * 100 <= rest_XA:
        rest_XAB = rest_XA - num_B * 100
        num_C = 0
        while num_C * 50 <= rest_XAB:
            rest_XABC = rest_XAB - num_C * 50
            if rest_XABC == 0:
                cnt += 1
            num_C += 1
        num_B += 1
    num_A += 1
print(cnt)

Submission status: Wrong Answer

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

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

counter = 0
for l in range(len((LI))):
    if LI[l] == 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

if 500*A >= X:
    a += 1

if 100*B >= X:
    a += 1

if 50*C >= X:
    a += 1

if (500*A + 100*B) >= X:
    a += 1

if (500*A + 50*C) >= X:
    a += 1

if (100*B + 100*C) >= X:
    a += 1

if (500*A + 100*B + 100*C) >= X:
    a += 1

print(a)

Submission status: Wrong Answer

Solution code:
# ABC 087: B – Coins
a, b, c, x = [int(input()) for _ in range(4)]
number_of_ways = 0

for i in range(a + 1):
    for j in range(b + 1):
        if 0 <= (x - (500 * i + 100 * j)) // 50 <= c:
            print(i, j, (x - (500 * i + 100 * j)) // 50)
            number_of_ways += 1

print(number_of_ways)

Submission status: Wrong Answer

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

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 i*500+j+100+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())

A = A if A == 0 else A + 1
B = B if B == 0 else B + 1
C = C if C == 0 else C + 1

cnt = 0
for a in range(A):
  for b in range(B):
    for c in range(C):
      if a * 500 + b * 100 + c * 50 == 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

for l in range(0, a):
    for m in range(0, b):
        for n in range(0, c):
            if(500*l+100*m+50*n == 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 + 1):
  for j in range(b + 1):
    ts = i * 500 + j * 100
    if x - ts >= 0 and (a - ts) % 50 == 0 and (a - ts) // 50 <= c:
      ans += 1
print(ans)

Submission status: Wrong Answer

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


x=X/50

count=0

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