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())
temp_list = []

for i in range(a+1):
    print(i)
    for j in range(b+1):
        for k in range(c+1):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n==x for n in temp_list].count(True)
print(ans)

Submission status: Wrong Answer

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

for i in range(a):
    for j in range(b):
        for k in range(c):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n==x for n in temp_list].count(True)
print(ans)

Submission status: Wrong Answer

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

for i in range(a):
    for j in range(b):
        for k in range(c):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n<x for n in temp_list].count(True)
print(ans)

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

Submission status: Wrong Answer

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

count = 0

for a in range(a_num + 1):
	a *= 500
	if a == x:
		count += 1
		continue
    
	for b in range(b_num + 1):
		b *= 100
		if (a + b) == x:
			count+=1
			continue
      
		for c in range(c_num + 1):
			c *= 100
			if (a + b + c) == x:
				count+=1
				continue

print(count)

Submission status: Wrong Answer

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

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

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

total = 0
ans = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            total = 500*a+100*b+50*c
            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())
i = 0
result = 0 

for d in range(a+1):
    x -= 500*d
    if not  x>0:
        i += 1
        break
    for e in range(b+1):
        x -= 100*e
        if not  x>0:
            i += 1
            break
        for f in range(c+1):
            x -= 10*f
            if not  x>0:
                i += 1
                break
print(i)

Submission status: Wrong Answer

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

req_500 = X//500
max_500 = min(req_500, A)

for i in range(0, max_500+1):
	X_sub500 = X - 500*i
	req_100 = X_sub500//100
	max_100 = min(req_100, B)
		
	for j in range(0, max_100+1):
		X_sub100 = X_sub500 - 100*j
		req_50 = X_sub100//50
		if req_50 <= C:
			count += 1

Submission status: Wrong Answer

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

counter = 0

for i in range(0, a + 1):
	if x - (500 * i) >= 0:
		x_f = x - (500 * i)

		if x_f == 0:
			counter += 1
			break

	for j in range(0, b + 1):
		if x_f - (100 * j) >= 0:
			x_s = x_f - (100 * j)

			if x_s == 0:
				counter += 1
				break

		for k in range(0, c + 1):
			if x_s - (50 * k) >= 0:
				x_t = x_s - (50 * k)

				if x_t == 0:
					counter += 1
					break


print(counter)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b
a, b, c, X = [int(input()) for i in range(4)]
n = 0
for i in range(X//500+1):
    if i > a:
        pass
    else:
        Y = X - 500 * i
        for j in range(Y // 100 + 1):
            if j > b:
                pass
            else:
                Z = Y - 100 * j
                for k in range(Z // 50 + 1):
                    if k > c:
                        pass
                    elif Z - 50 * k == 0:
                        n += 1
                        print(i,j,k,X,Y,Z)
                    else:
                        pass

print(n)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b
a, b, c, X = [int(input()) for i in range(4)]
n = 0
for i in range(X//500+1):
    if i > a:
        pass
    else:
        Y = X - 500 * i
        for j in range(Y // 100 + 1):
            if j > b:
                pass
            else:
                Z = Y - 100 * j
                for k in range(Z // 50 + 1):
                    if k > b:
                        pass
                    elif Z - 50 * k == 0:
                        n += 1
                    else:
                        pass

print(n)

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):
    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,B,C,X = map(int,open(0).read().split())
a = 0
for i in range(A+1):
    for l in range(B+1):
        for q in range(C+1):
            if 500*i+100*B+50*C == X:
                a += 1
print(a)

Submission status: Wrong Answer

Solution code:
A,B,C,X = map(int,open(0).read().split())
a = 0
for i in range(1,A+1):
    for l in range(1,B+1):
        for q in range(1,C+1):
            if 500*i+100*B+50*C == X:
                a += 1
print(a)

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

Submission status: Wrong Answer

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

counter = 0

for _a in range(a):
    for _b in range(b):
        for _c in range(c):
            ans = 500*_a + 100*_b + 50*_c
            if ans == x:
                counter += 1

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
out = 0
 
for ai in range(0, a+1):
  if ai * 500 > x:
    break
  if ai * 500 is x:
    out += 1
  for bi in range(0, b+1):
    if (bi * 100) > (x - ai * 500):
      break
    if (bi * 100) is (x - ai * 500):
      out += 1
    for ci in range(0, c+1):
      if (ci * 50) > (x - ai * 500 - bi * 100):
        break
      if (ci * 50) is (x - ai * 500 - bi * 100):
        out += 1
        
print(out)

Submission status: Wrong Answer

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

out = 0

for ai in range(0, a):
  if ai * 500 > x:
    break
  if ai * 500 is x:
    out += 1
    break
  for bi in range(0, b):
    if bi * 100 > x - ai * 500:
      break
    if bi * 100 is x - ai * 500:
      out += 1
      break
    for ci in range(0, c):
      if ci * 50 > x - ai * 500 - bi * 100:
        break
      if ci * 50 is x - ai * 500 - bi * 100:
        out += 1
        break
        
print(out)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
res = 0
# +1 しないと実際に input() から取得した値が range で処理できない
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            total = 500 * a + 100 * b + 50 * c
            if total is X:
                res += 1
print(res)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
count=0
a=int(input())
b=int(input())
c=int(input())
x=int(input())
for i in range(1,c+1):
    for j in range(1,b+1):
        for u in range(1,a+1):
            if i*500+j*100+u*50:
                count+=1
print(count)

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 X == A * i * 500 + B * j * 100 + C * k * 50: res += 1
print(res)

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input()) // 50
res = 0
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if X == A * i * 10 + B * j * 2 + C * k: 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 X == A * i + B * j + C * k: 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 i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*1 + 100*j + 50*k == X:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c, x = [int(input()) for _ in range(4)]
cnt = 0
for i in range(a):
    for j in range(b):
        for k 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())
ans = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            tmp = 500*A + 100*B + 50*C
            if tmp == 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 % 100 == 50 and C % 2 == 0:
    print(0)

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

def solve(A,B,C):
    count = 0
    for a in A: 
        for b in B:
            for c in C:
                if 500*a + 100*b + 50*c == X:
                    count += 1
            
    return 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
n=0

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

print(n)

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())
Ans=0
for x in range(A):
  for y in range(B):
    for z in range(C):
      if 500*x + 100*y + 50*z == X:
        Ans += 1

print(Ans)

Submission status: Wrong Answer

Solution code:
A,B,C,X= [int(input()) for x in range(4)] 
ans = 0
for a in range(0,A):
	for b in range(0,B):
		for c in range(0,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())
Y = 0
for i in range(A):
    for j in range(B):
        for k in range(C):
            if i*500 + j*100 + k*50 == X:
                Y += 1
print(Y)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B, C, X = [int(input()) for _ in range(4)]
        ans = 0
        for a in range(A):
            for b in range(B):
                for c in range(C):
                    if 500*a+100*b+50*c == X:
                        ans +=1
        print(ans)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

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

count = 0

for i in range(a+1):
    y = x-500 * i
    if y >= 0:
        for j in range(b+1):
            z = y-100*j
            w = int(z/50)
            if w <= c+1 and z >= 0:
                count += 1

print(count)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
a,b,c,x=map(int,open(0))
print(sum(500*i+100*j+50*k==x for i in range(a)for j in range(b)for k in range(c)))

Submission status: Wrong Answer

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

if X%100 == 50:
  X -= 50

c = 0

m500 = min(X//500, A) #500円玉の最大個数
for m in range(m500+1):
  c += min((X-500*m)//100 + 1, B + 1)

print(c)

Submission status: Wrong Answer

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

if X%100 == 50:
  X -= 50

c = 0

m500 = min(X//500, A) #500円玉の最大個数
for m in range(m500+1):
  c += min((X-500*m)//100 + 1, B + 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+1):
    for i in range(b+1):
        for i in range(c+1):
            if x == 500*a + 100*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())
ans=0
for i in range(1,a+1):
  for s in range(1,b+1):
    for t in range(1,c+1):
      if (i*500+s*100+t*50)==x:
        ans=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):
  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())
c=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:
                c+=1
print(c)

Submission status: Wrong Answer

Solution code:
def resolve():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    ans = 0
    for ai in range(max(41, a + 1)):
        for bi in range(b + 1):
            for ci in range(c + 1):
                mon = 500 * ai + 100 * bi + 50 * ci
                if mon == x:
                    ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    ans = 0
    for ai in range(max(41, a + 1)):
        for bi in range(b + 1):
            for ci in range(c + 1):
                mon = 500 * ai + 100 * bi + 50 * ci
                if mon > x:
                    break
                if mon == x:
                    ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from heapq import heapify, heappop, heappush
from sys import stdin

def main():
    A = int(input())
    B = int(input())
    C = int(input())
    x = int(input())

    ans = 0
    for a in range(1, A+1):
        for b in range(1, B+1):
            for c in range(1, C+1):
                if 500*a+50*b+10*c == x:
                    ans += 1
    print(ans)

input = lambda: stdin.readline().rstrip()
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+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500 * i + 100 * j + 50 * k == x:
                count += 1

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
0 <= a,b,c <=50
1 <= a+b+c 
50 <= x <= 20000
a=x//500
list_b=[]
for i in range(0,a+1):
    b=(x-500*i)//100
    list_b.append(b)
#print(list_b)
list_c=[j+1 for j in list_b]
#print(list_c)
print(sum(list_c))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
a=x//500
list_b=[]
for i in range(0,a+1):
    b=(x-500*i)//100
    list_b.append(b)
#print(list_b)
list_c=[j+1 for j in list_b]
#print(list_c)
print(sum(list_c))

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
x=500*a+100*b+50*c
0<= a, b, c <=50
1<= a+b+c <=50
50<= x <=20000
list_a=[0]
for i in range(0,a):
    for j in range(0,b):
        list_a.append(str("i""j"))
print(len(list_a))

Submission status: Wrong Answer

Solution code:
a, b, c, x = [int(input()) for _ in range(4)]
count=0
a2 = x // 500 #500円玉は何枚必要か
if a < a2: #足りない時
    a3 = a
else: #足りてる時
    a3 = a2
for i in range(a3+1):
    y = x -500*i
    b2 = y//100
    if b < b2:
        b3 = b
    else:
        b3 = b2
        for j in range(b3+1):
            z = y -100*j
            if z % 50 == 0 and z /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())
print(len([1 for B in range(b+1) for C in range(c+1) if (x-(100*B)-(50*C))%500==0 and (x-(100*B)-(50*C))>=0]))

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for B in range(b+1) for C in range(c+1) if (x-(100*B)-(50*C))%500==0]))

Submission status: Wrong Answer

Solution code:
a,b,c,x=[int(input()) for i in range(4)]
print(sum(x-500*A-100*B>=0 for A in range(a+1) for B in range(b+1)))

Submission status: Wrong Answer

Solution code:
arr = [input() for i in range(4)]

count = 0
for fi in range(0, int(arr[0])+1):
    for hun in range(0, int(arr[1])+1):
        for fifty in range(0, int(arr[2])+1):
            sum = fi * 500 + hun * 100 + fifty * 50
            if sum == arr[3]:
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
arr = [input() for i in range(4)]

count = 0
for fi in range(0, int(arr[0])):
    for hun in range(0, int(arr[1])):
        for fifty in range(0, int(arr[2])):
            sum = fi * 500 + hun * 100 + fifty * 50
            if sum == arr[3]:
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = (n//4 - 1)
if n < 4 :
  print("No")
elif n % 4 == 0 :
  print("Yes")
elif (n - a*4) % 7 == 0 :
  print("Yes")
else :
  print("No")

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(A + 1):
    if workX > 500 * i:
        workX -= 500 * i
    elif workX == 500 * i:
        cnt += 1
        continue
    else:
        break

    for j in range(B + 1):
        if workX > 100 * j:
            workX -= 100 * j
        elif workX == 100 * j:
            cnt += 1
            break

        if workX % 50 == 0 and workX <= 50 * C:
            cnt += 1
            workX += 100 * j
            continue
        else:
            workX += 100 * j

    workX = X

print(cnt)

Submission status: Wrong Answer

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

if X > 500 * A + 100 * B + 50 * C:
    print(0)

workX = X

for i in range(A + 1):
    if workX > 500 * i:
        workX -= 500 * i
    elif workX == 500 * i:
        cnt += 1
        continue
    else:
        break

    for j in range(B + 1):
        if workX > 100 * j:
            workX -= 100 * j
        elif workX == 100 * j:
            cnt += 1
            break

        if workX % 50 == 0 and workX <= 50 * C:
            cnt += 1
            workX += 100 * j
            continue
        else:
            workX += 100 * j

    workX = X

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
Money_500 = int(input())
Money_100 = int(input())
Money_50  = int(input())
Amount    = int(input())
Count = 0

if Amount % 50 != 0 or Amount / 1 == 0 or Amount < 50 :
    print(Count)
    print('break')
    sys.exit()

#五百円の動作

if Money_500 >= Amount / 500 and Amount % 500 == 0:
    Count += 1

for i in range(0,Money_500+1):
    if Amount < i * 500 and i >= 1:
        break

    if ( Amount - ( i * 500 )) >= 100:

        for x in range(0,Money_100+1):
            if ( Amount - ( i * 500 )) - (x * 100) < 0 and i >= 1:
                break

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

print(ans)

Submission status: Wrong Answer

Solution code:
def hantei(n, m, l, d ):
    if (n*500+m*100+l*50)==d:
        # print("n,m,l",n,m,l)
        return True
    return False

a = int(input()) #five
b = int(input()) #hund
c = int(input()) #fift
d = int(input()) #

n=m=l=0
result=0

while(n <= a):
    m=l=0
    while(m <= b):
        l=0
        while(l <= c):
            # print("n,m,l",n,m,l)
            if hantei(n,m,l,d)==True:
                result += 1
            l+=1
        if hantei(n,m,l,d)==True:
            result += 1
        m+=1
    if hantei(n,m,l,d)==True:
        result += 1
    n+=1

print(result)

Submission status: Wrong Answer

Solution code:
def hantei(n, m, l, d ):
    if (n*500+m*100+l*50)==d:
        print("n,m,l",n,m,l)
        return True
    return False

a = int(input()) #five
b = int(input()) #hund
c = int(input()) #fift
d = int(input()) #

n=m=l=0
result=0

while(n <= a):
    m=l=0
    while(m <= b):
        l=0
        while(l <= c):
            # print("n,m,l",n,m,l)
            if hantei(n,m,l,d)==True:
                result += 1
            l+=1
        if hantei(n,m,l,d)==True:
            result += 1
        m+=1
    if hantei(n,m,l,d)==True:
        result += 1
    n+=1

print(result)

Submission status: Wrong Answer

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


la=[]
for a in range(A+1):
    la.append(a)

lb=[]
for b in range(B+1):
    lb.append(b)

lc=[]
for c in range(C+1):
    lc.append(c)

count=0
for i in range(A):
    for j in range(B):
        for p in range(C):
            if(500*la[i]+100*lb[j]+50*lc[p]==x):
                count+=1
print(count)

Submission status: Wrong Answer

Solution code:
#ABC 087 B - Coins
import math
s = 0 #払い方の総数
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
x = int(input()) #払うべき総額

while x >= 0 and a>=0 :
    s += max(0, min(b, math.floor(x/100))-max(0,math.ceil((x-50*c)/100))+1)
    print("\n","500円玉が残り"+str(a)+"枚の時")
    print(str(x)+"円を作る")
    print("\n","使える100円玉の最大数:" + str(min(b, math.floor(x/100))))
    print("使える100円玉の最小数:" + str(max(0,math.ceil((x-50*c)/100))))
    print(s)
    print()
    a -= 1
    x -= 500
print(s)

Submission status: Wrong Answer

Solution code:
#ABC 087 B - Coins
import math
s = 0 #払い方の総数
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
x = int(input()) #払うべき総額

while x >= 0 and a>=0 :
    s += max(0, min(b, math.floor(x/100))-math.ceil((x-50*c)/100)+1)
    print(min(b, math.floor(x/100)))
    print(math.ceil((x-50*c)/100))
    print(a,x,s)
    a -= 1
    x -= 500
print(s)

Submission status: Wrong Answer

Solution code:
import math
s = 0 #払い方の総数
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
x = int(input()) #払うべき総額

while x >= 0 and a>=0 :
    s += max(0, math.floor(min(b, x//100)-(x-50*c)//100+1))
    print(a,x,s)
    a -= 1
    x -= 500
print(s)

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*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
for ai in range(a + 1):
    for bi in range(b + 1):
        for ci in range(c + 1):
            if 500 == 500 * ai + 100 * bi + 50 *ci:
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
count_50 = int(input())
count_100 = int(input())
count_500 = int(input())
target = int(input())
count = 0

for num_50 in range(0, count_50 + 1):
    total = num_50 * 50
    if total == target:
        count += 1
        continue
    for num_100 in range(0, count_100 + 1):
        total_2 = num_50 * 50 + num_100 * 100
        if total_2 == target:
            count += 1
            continue
        for num_500 in range(0, count_500+1):
            total_3 = num_50 * 50 + num_100 * 100 + num_500 * 500
            if total_3 == target:
                count += 1
                continue
print(count)

Submission status: Wrong Answer

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

asum=0
bsum=0
csum=0
cnt=0

for aa in range(0, a):
  #print(asum)
  if asum > x:
    break
  elif asum == x:
    cnt += 1
  
  bsum=0
  for bb in range(0, b):
    #print('bsum:{}'.format(asum + bsum))
    if asum + bsum > x:
      break
    elif asum + bsum == x:
      cnt += 1
      
    csum=0
    for cc in range(0, c):
      if asum + bsum + csum > x:
        break
      elif asum + bsum + csum == x:
        cnt += 1
        
      csum += ctani
    
    bsum += btani
  
  asum += atani

bsum=0        
for bb in range(0, b):
    #print('bsum:{}'.format(asum + bsum))
    if bsum > x:
      break
    elif bsum == x:
      cnt += 1
      
    csum=0
    for cc in range(0, c):
      if bsum + csum > x:
        break
      elif bsum + csum == x:
        cnt += 1
        
      csum += ctani
    
    bsum += btani

csum=0        
for cc in range(0, c):
    if csum > x:
      break
    elif csum == x:
      cnt += 1
        
    csum += ctani
    
print(cnt)

Submission status: Wrong Answer

Solution code:
A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input())
count = 0 #初期値
           
#全件走査
maxA = X // 500 if 500 * A > X else A
for i in range(maxA + 1):
  maxB = (X - 500 * i) // 100 if 100 * B > (X - 500 * i) else B
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 #初期値
           
#全件走査
maxA = X // 500 if 500 * A > X else A
  
print(count)

Submission status: Wrong Answer

Solution code:
A = int(input()) #500