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: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

print(output)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n500=int(input())
n100=int(input())
n50=int(input())
S=int(input())
a=0
for i in range(n500+1):
  for k in range(n100+1):
    for c in range(n50+1):
      s=500*i+100*k+50*c
      if s==S:
        a +=1
print(a)

Submission status: Accepted

Solution code:

# ABC-087_B-Coins

A_num = int(input())
B_num = int(input())
C_num = int(input())
X_yen = int(input())
count = 0

for a in range(A_num+1):
    for b in range(B_num+1):
        for c in range(C_num+1):
            total = 500*a + 100*b + 50*c
            if total == X_yen:
                count += 1
print(count)

Submission status: Accepted

Solution code:
A, B, C, X = map(int, open(0).read().split())
ans = 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:
                ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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
print(count)

Submission status: Accepted

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

count = 0
for a in range(A + 1):
	for b in range(B + 1):
		value = 500 * a + 100 * b
		#print(value)
		if value <= X and (X - value) // 50 <= C:
			count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

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

count = 0
max_a = min(X // 500, A)
for i in range(max_a+1):
  x = X - 500 * i
  max_b = min(x // 100, B)
  for j in range(max_b+1):
    y = x - 100 * j
    c = y // 50
    if c <= C:
      count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

y = 0

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

Submission status: Accepted

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

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

print(y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cnt500=int(input())
cnt100=int(input())
cnt50=int(input())
price=int(input())

cnt=0
for a in range(cnt500+1):
  if cnt500*a > price:
    break
  for b in range(cnt100+1):
    if cnt100*b > price:
      break
    for c in range(cnt50+1):
      if cnt50*c > price:
        break
      if a*500+b*100+c*50 == price:
        cnt+=1
print(cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500+1):
  for j in range(b100+1):
    for k in range(c50+1):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
        break
print(ans)

Submission status: Accepted

Solution code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500+1):
  for j in range(b100+1):
    for k in range(c50+1):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cou = 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:
                cou += 1
print(cou)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
a, b, c, x = [int(sys.stdin.readline()) 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 i * 500 + j * 100 + k * 50 == x:
                count += 1
print(count)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
counter = 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:
                counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

for ia in range(a+1):
	for ib in range(b+1):
		for ic in range(c+1):
			if x == ia*500+ib*100+ic*50:
				ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
for aa in range(a+1):
  for bb in range(b+1):
    for cc in range(c+1):
      if x == aa*500 + bb * 100 + cc * 50:
        result = result + 1

print(result)

Submission status: Accepted

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

ans=0
a=math.floor(X/500)
for i in range(min(A,a)+1):
    X2=X-500*i
    b=math.floor(X2/100)
    for j in range(min(B,b)+1):
        X3=X2-100*j
        if X3%50==0:
            c=X3/50
            if c<=C:
                ans+=1
            else:
                continue
        else:
            continue
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
print(len([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]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for l in range(A + 1):
    for m in range(B + 1):
        for n in range(C + 1):
            if 500 * l + 100 * m + 50 * n == X:
                count += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 = 500*i + 100*j + 50*k
			if total == x:
				count += 1

print(count)

Submission status: Accepted

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

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

print ctr

Submission status: Accepted

Solution code:
#087 B Coins
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 * i + 100 * j + 50 * k ==X:      
                ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC087B - Coins

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
print(count)

Submission status: Accepted

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

print(count)

#全ての場合について計算したい場合はこのようにfor文を重ねてそれぞれのi,j,kをうまく使用する。

Submission status: Accepted

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

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

print(sums.count(x))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

for an in range(A+1):
    for bn in range(B+1):
        for cn in range(C+1):
            if 500*an+100*bn+50*cn==X:
                counter+=1

print(counter)

Submission status: Accepted

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

for rep1 in range(a + 1):
    for rep2 in range(b + 1):
        for rep3 in range(c + 1):
            if rep1 * 500 + rep2 * 100 + rep3 * 50 == x:
                counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#枚数の入力
input500=int(input())
input100=int(input())
input50=int(input())
inputSum=int(input())

#通りの変数
sumWay=0
tempSum=0

if inputSum >= 500:
    #500円の計算
    for i in range(input500 + 1):
        tempSum=0
        tempSum+=(500 * i)
        
        #ここで全体を抜ける処理
        if inputSum == tempSum:
            sumWay+=1
            break
        
        elif tempSum < inputSum :
            #100円の計算
            for m in range(input100 + 1):
                tempSum100=tempSum
                tempSum100=tempSum + (100 * m)
                if inputSum < tempSum100:
                    break
                elif tempSum100 == inputSum:
                    sumWay+=1
                    continue
                else:
                    #50円の計算
                    for n in range(input50 + 1):
                        tempSum50=tempSum100
                        tempSum50= tempSum100 + (50 * n)
                        #ピッタリ
                        if inputSum == tempSum50:
                            sumWay+=1
                            continue
                        elif inputSum < tempSum50:
                            break
elif inputSum < 500 and inputSum >= 100:
#100円の計算
    for m in range(input100 + 1):
        tempSum100= 100 * m
        if inputSum < tempSum100:
            break
        elif tempSum100 == inputSum:
            sumWay+=1
            continue
        else:
            #50円の計算
            for n in range(input50 + 1):
                tempSum50=tempSum100
                tempSum50= tempSum100 + (50 * n)
                #ピッタリ
                if inputSum == tempSum50:
                    sumWay+=1
                    continue
                elif inputSum < tempSum50:
                    break
elif inputSum < 100:
#50円の計算
    for n in range(input50 + 1):
        tempSum50= 50 * n
        #ピッタリ
        if inputSum == tempSum50:
            sumWay+=1
            continue
        elif inputSum < tempSum50:
            break

print(sumWay)

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
price = 0
c = 0
b = 0
a = 0

def sum_price(a, b, c):
    return a*500 + b*100 + c*50

while c <= C:
    if sum_price(a, b, c) == X:
        cnt += 1
        break
    while b <= B:
        if sum_price(a, b, c) == X:
            cnt += 1
            break
        while a <= A:
            if sum_price(a, b, c) == X:
                cnt += 1
                break
            a += 1
        a = 0
        b += 1
    b = 0
    c += 1

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
coin = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a + b + c == 0:
        continue
      else:
        if X == coin.dot(np.array([a,b,c])):
            count += 1
print(count)

Submission status: Accepted

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

Solution code:
a, b, c, x = eval("int(input())," * 4)  #文字の定義
count = 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:
				count += 1
print(count)

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

p = 0 # num of patterns

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(4):
    list += [int(input())]

count = 0
for ii in range(list[0] + 1):
    for jj in range(list[1] + 1):
        for kk in range(list[2] + 1):
            count += list[3] == 500 * ii + 100 * jj + 50 * kk

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Input
list = []
for _ in range(4):
    list += [int(input())]

count = 0
for ii in range(list[0] + 1):
    for jj in range(list[1] + 1):
        for kk in range(list[2] + 1):
            if list[3] == 500 * ii + 100 * jj + 50 * kk:
                count += 1

print(count)

Submission status: Accepted

Solution code:
fh = int(input())
h = int(input())
f = int(input())
p = int(input())

ans = 0
for i in range(fh + 1):
  for j in range(h + 1):
    for k in range(f + 1):
      if 500 * i + 100 * j + 50 * k == p:
        ans += 1
print(ans)

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

Solution code:

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

count = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
tmp = []
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: Accepted

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

count = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if (10*a+2*b+c == int(X/50)):
        count +=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A = int(input())
B = int(input())
C = int(input())
X = int(input())
counter = 0
for i in range(A+1):
    for j in range(B+1):
        total = 500*i + 100*j
        if total == X:
            counter += 1
        for k in range(C):
            total += 50
            if total == X:
                counter += 1
            elif total > X:
                break
print(counter)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
# B 087 

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(ct)

Submission status: Accepted

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

Submission status: Accepted

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

aa = 0
while aa<=a:
  bb = 0
  while bb<=b:
    cc = 0
    while cc<=c:
      if aa * 500 + bb * 100 + cc * 50 == x:
        ans += 1
      cc += 1
    bb += 1
  aa += 1

print(ans)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import sys


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

ans = 0
for a in range(51):
  for b in range(51):
    if (X - a*500 - b*100) % 50 > 0 or a > A or b > B:
      continue
    else:
      c = (X - a*500 - b*100) // 50
      if c >= 0 and c <= C:
        ans += 1

print(ans)

Submission status: Accepted

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

res = 0

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

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
coin_list = []
for i in range(3):
    s = int(input())
    coin_list.append(s)
target = int(input())
counter = 0

for a in range(coin_list[0]+1):
    for b in range(coin_list[1]+1):
        for c in range(coin_list[2]+1):
            total = 500*a + 100*b + 50*c
            if total == target:
                counter = counter + 1
            if total > target:
                break

print(counter)

Submission status: Accepted

Solution code:
coin_list = []
for i in range(3):
    s = int(input())
    coin_list.append(s)
target = int(input())
counter = 0

for a in range(coin_list[0]+1):
    for b in range(coin_list[1]+1):
        for c in range(coin_list[2]+1):
            total = 500*a + 100*b + 50*c
            if total == target:
                counter = counter + 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import time

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

# start_time = time.time()
z = 0
for i in range(c+1):
    # print(i)
    for j in range(b+1):
        # print(" ", j)
        for k in range(a+1):
            # print("  ", k)
            # print("!",x - 50 * i - 100 * j - 500 * k)
            if x - 50 * i - 100 * j - 500 * k == 0:
                z += 1
print(z)
# end = time.time()
# print(end - start_time)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
list_A = list(range(A+1))
list_B = list(range(B+1))
list_C = list(range(C+1))
cnt = 0
for i in range(len(list_A)):
        for j in range(len(list_B)):
                for k in range(len(list_C)):
                        if X-(list_A[i]*500+list_B[j]*100+list_C[k]*50) == 0:
                                cnt += 1
                        else:
                                continue
print(cnt)

Submission status: Accepted

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

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