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:
x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0


def judge(i, j, k, xxx):
    sum = 500 * i + 100 * j + 50 * k
    return sum == xxx and sum <= 2000


count = 0
for i in range(x500 + 1):
    if judge(i, j, k, xxx):
        count += 1
    for j in range(x100 + 1):
        if judge(i, j, k, xxx):
            count += 1
        for k in range(x50 + 1):
            if judge(i, j, k, xxx):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0


def judge(i, j, k, xxx):
    sum = 500 * i + 100 * j + 50 * k
    return sum == xxx and sum <= 2000


count = 0
for i in range(x500):
    if judge(i, j, k, xxx):
        count += 1
    for j in range(x100):
        if judge(i, j, k, xxx):
            count += 1
        for k in range(x50):
            if judge(i, j, k, xxx):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0

count = 0
for i in range(x500):
    if 500 * i + 100 * j + 50 * k == xxx:
        count += 1
    for j in range(x100):
        if 500 * i + 100 * j + 50 * k == xxx:
            count += 1
        for k in range(x50):
            if 500 * i + 100 * j + 50 * k == xxx:
                count += 1
print(count)


def total(i, j, k):
    return 500 * i + 100 * j + 50 * k

Submission status: Wrong Answer

Solution code:
A=[]
for _ in range(3):
    A.append(int(input()))
a=A[0]
b=A[1]
c=A[2]
x=int(input())
count=0
for p in range(a):
    for q in range(b):
        for r in range(c):
            if 500*p+100*q+50*r==x:
                count=count+1
else:
    count=count
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 j in range(1,b+1):
    for k in range(1,c+1):
      y = i*500 + j*100 + k*50
      if x == y:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=int(input())
z=int(input())
result=int(input())
count=0
for i in range(x):
        for j in range(y):
            for k in range(z):
                    if i*500+j*100+k*50==result:
                        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 ai in range(a):
    for bi in range(b):
        for ci in range(c):
            amount = 500 * ai + 100 * bi + 50 * ci
            if amount == x:
                ans += 1

print(ans)

Submission status: Wrong Answer

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

import itertools
len([total for total in map(sum, itertools.product(
    [500 * i for i in range(A + 1)],
    [100 * i for i in range(B + 1)],
    [50 * i for i in range(C + 1)],
)) if total == X])

Submission status: Wrong Answer

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

import itertools
len([c for c in set(map(tuple, itertools.chain.from_iterable(itertools.combinations(itertools.chain(itertools.repeat(500, A), itertools.repeat(100, B), itertools.repeat(50, C)), r) for r in range(A + B + C + 1)))) if sum(c) == X])

Submission status: Wrong Answer

Solution code:
A=int(input())
B=int(input())
C=int(input())
x=int(input())
s=0
for i in range(A+1):
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
  if x<0: break
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(A+1):
  for t in range(B+1):
    if x<0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
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(A+1):
  for t in range(B+1):
    if x<=0: break
    elif 50*C>=x:
      s+=1
      x-=100
    else: x-=100
  x-=500
print(s)

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

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

Submission status: Wrong Answer

Solution code:
A = int(input("A =")) 
B = int(input("B =")) 
C = int(input("C =")) 
X = int(input("50の倍数X = "))
count = 0

for A in range(0,A+1):
    for B in range(0,B+1):
        for C in range(0,C+1):
            price = A * 500 + B * 100 + C * 50 
            if price == X:
                count += 1
            else:
                continue
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):
    for j in range(0,b):
        for k in range(0,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())
count = 0
ans = []
ans.append(min(X//500,A))
ans.append(min(X//100,B))
ans.append(min(X//50,C))
for i in range(ans[0]):
    for j in range(ans[1]):
        for k in range(ans[2]):
            p = i * 500 + j * 100 + k * 50
            if p == X:
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import sys


lines = 4
inp = list()

for _ in range(lines):
    inp.append(sys.stdin.readline().strip())

n50 = int(inp[0])
n100 = int(inp[1])
n500 = int(inp[2])
total = int(inp[3])

pattern = 0

i = 0
while i * 500 < total and i <= n500:
    j = 0
    while j * 100 < total and j <= n100:
        k = 0
        while k * 50 < total and k <= n50:
            if i * 500 + j * 100 + k * 50 == total:
                pattern += 1
            k += 1
        j += 1
    i += 1

print(pattern)

Submission status: Wrong Answer

Solution code:
import sys


lines = 4
inp = list()

for _ in range(lines):
    inp.append(sys.stdin.readline().strip())

n50 = int(inp[0])
n100 = int(inp[1])
n500 = int(inp[2])
total = int(inp[3])

i, j, k = 0, 0, 0
pattern = 0

while i * 500 < total and i <= n500:
    while j * 100 < total and j <= n100:
        while k * 50 < total and k <= n50:
            if i * 500 + j * 100 + k * 50 == total:
                pattern += 1
            k += 1
        j += 1
    i += 1

print(pattern)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
A = int(input())
B = int(input())
C = int(input())
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 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
total = 0
for a in range(A):
  for b in range(B):
    for c in range(C):
      total = 500*a + 100*b +50*c
      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())

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

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

  print(cnt)

Submission status: Wrong Answer

Solution code:
numof500 = int(input())
numof100 = int(input())
numof50  = int(input())
moneyneeded = int(input())
 
counter = 0
for i in range(numof500):
  for j in range(numof100):
    for k in range(numof50):
      if 500 * i + 100 * j + 50 * k == moneyneeded:
        counter += 1
 
print(counter)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

total=0
count=0

for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            total=500*l + 100*m + 50*n
            print(total)
            if(total==X): count += 1
                
print(count)

Submission status: Wrong Answer

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

count = 0

for i in range(1, coins[0] + 1):
  for j in range(1, coins[1] + 1):
    for k in range(1, coins[2] + 1):
      ans = 500*i + 100*j + 50*k
      if ans == coins[3]:
        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):
        nc = (500 * i + 100 * j) // 50
        if nc < 0 or c < nc:
            continue
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0: #and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            if xB <= B:
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
            else:
                yB = B
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0: #and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                if xB <= B:
                    yB = xB
                    yC = xC
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                else:
                    yB = B
                    yC = x - xA * 10 - xB * 2
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    pass
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0: #and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            if xB <= B:
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
            else:
                yB = B
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0: #and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                if xB <= B:
                    yB = xB
                    yC = xC
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                else:
                    yB = B
                    yC = x - xA * 10 - xB * 2
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0: #and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            if xB <= B:
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
            else:
                yB = B
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0: #and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                if xB <= B:
                    yB = xB
                    yC = xC
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                else:
                    yB = B
                    yC = x - xA * 10 - xB * 2
                    while yB >= 0 and yC <= C:
                        #print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0: #and xB <= B:
            print(str(xA)+', '+str(xB)+', '+str(xC))
            if xB <= B:
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
            else:
                yB = B
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0: #and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                if xB <= B:
                    yB = xB
                    yC = xC
                    while yB >= 0 and yC <= C:
                        print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
                else:
                    yB = B
                    yC = x - xA * 10 - xB * 2
                    while yB >= 0 and yC <= C:
                        print(str(yB)+', '+str(yC))
                        yB = yB - 1
                        yC = yC + 2
                        y = y + 1
                    xA = xA -1
                    xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = x - xA * 10 - yB * 2
                while yB >= 0 and yC <= C:
                    print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    #print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0 and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            yB = xB
            yC = xC
            while yB >= 0 and yC <= C:
                #print(str(yB)+', '+str(yC))
                yB = yB - 1
                yC = yC + 2
                y = y + 1
            xA = xA -1
            xB = xB + 5

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
#例題4
A = int(input())
B = int(input())
C = int(input())
X = int(input())
if A>50 or B>50 or C>50 or X<50 or X>20000 or X % 50 != 0:
    print('error')
else:
    x = X // 50
    print(x)
    y = 0
    xA = x // 10
    xB = (x - xA * 10) //2
    xC = x - xA * 10 - xB * 2
    #print(str(xA)+', '+str(xB)+', '+str(xC))
    if xA <= A:
        while xA >= 0 and xB <= B:
            #print(str(xA)+', '+str(xB)+', '+str(xC))
            yB = xB
            yC = xC
            while yB >= 0 and yC <= C:
                #print(str(yB)+', '+str(yC))
                yB = yB - 1
                yC = yC + 2
                y = y + 1
            xA = xA -1
            xB = xB + 5

    else:
        xA = A
        xB = (x - xA * 10)//2
        if xB <= B:
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
        else:
            xB = B
            xC = (x - xA * 10 - xB * 2)
            y = 0
            while xA >= 0 and xB <= B:
                #print(str(xA)+', '+str(xB)+', '+str(xC))
                yB = xB
                yC = xC
                while yB >= 0 and yC <= C:
                    #print(str(yB)+', '+str(yC))
                    yB = yB - 1
                    yC = yC + 2
                    y = y + 1
                xA = xA -1
                xB = xB + 5
                    
print(y)

Submission status: Wrong Answer

Solution code:
a,b,c,x=[int(input()) for _ in range(4)]
print(len([1 for i in range(a+1) for j in range(b+1) if (x-500*a-100*b)%50==0 and 0<=(x-500*a-100*b)//50 <=c]))

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for a in range(A):
  for b in range(B):
    for c 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())
t=0
for i in range(a+1):
  for j in range(c+1):
    for k in range(c+1):
      if 10*i+2*j+k==x/50:
        t+=1
print(t)

Submission status: Wrong Answer

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

c=0

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

print(c)

Submission status: Wrong Answer

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m > x:
        break
      elif m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
    if m > x:
      break
  i2 = 0
  i1 += 1
  if m > x:
    break
print(p)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m1, m2, m3, p = 0, 0, 0, 0
while i1 <= a:
  m1 = 500 * i1
  while i2 <= b:
    m2 = m1 + 100 * i2
    while i3 <= c:
      m3 = m2 + 50 * i3
      print(str(i1) + str(i2) + str(i3) + str(m3))
      if m3 < x:
        i3 += 1
        continue
      elif m3 > x:
        break
      else:
        p += 1
        break
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
A,B,C,X = [int(input()) for i in range(4)]#500,100, 50, 合計

ans = 0

for a in range(0,A):
    for b in range(0,B):
        for c in range(0,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())

total = 0
count = 0

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