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,B,C,X = [int(input()) for i in range(4)]

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

cont = 0

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

print(cont)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

count = 0

for an in range(a+1):
    if 500 * an == x:
        count += 1
        break
    else:
        for bn in range(b+1):
            if 500 * an + 100 * bn == x:
                count += 1
                break
            else:
                for cn in range(c+1):
                    if 500 * an + 100 * bn + 50 * cn == x:
                        count += 1
                        break

print(count)

Submission status: Accepted

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)
    a -= 1
    x -= 500
print(s)

Submission status: Accepted

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

count = 0
for ap in range(a+1):
	for bp in range(b+1):
		for cp in range(c+1):
			val = 500*ap + 100*bp + 50*cp
			if val == x:
				count += 1

print(count)

Submission status: Accepted

Solution code:
A = int(input()) # 500 yen
B = int(input()) # 100 yen
C = int(input()) # 50  yen
X = int(input()) # sum
comb = 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:
                comb+=1
                
print(comb)

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

print(count)

Submission status: Accepted

Solution code:
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:
def coins(charge, five_hundreds, hundred, fifty):
    count = 0
    for a in range(five_hundreds + 1):
        for b in range(hundred + 1):
            for c in range(fifty + 1):
                if 500 * a + 100 * b + 50 * c == charge:
                    count += 1
    return count

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

print(coins(charge, a, b, c))

Submission status: Accepted

Solution code:
def intget():
    return int(input())

def countup_coin(coin_unit, coin_nums):
    ret = []
    for i in range(0, coin_nums+1):
        ret += [coin_unit * i]

    return ret


i_500 = intget()
i_100 = intget()
i_50 = intget()
expect = intget()

ptn_count = 0

coin_ptn_500 = countup_coin(500, i_500)
coin_ptn_100 = countup_coin(100, i_100)
coin_ptn_50 = countup_coin(50, i_50)

for i in coin_ptn_500:
    for j in coin_ptn_100:
        for k in coin_ptn_50:
            if (i + j + k) == expect:
                ptn_count += 1

print(ptn_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for p in range(a+1):
    for q in range(b+1):
        for r in range(c+1):
            if p*500+q*100+r*50 == x:
                count += 1
print(count)

Submission status: Accepted

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

print(sum([(500 * i + 100 * j + 50 * k) == x for k in range(c + 1) for j in range(b + 1) for i in range(a + 1)]))

Submission status: Accepted

Solution code:
h500 = int(input())
h100 = int(input())
h050 = int(input())
goal = int(input())
ans = 0
i500 = 0
while i500 <= h500:
  i100 = 0
  while i100 <= h100:
    if 0 <= (goal - 500 * i500 - 100 * i100) // 50 <= h050:
      ans += 1
      #print(i500,i100,(goal-500*i500-100*i100)//50)
    i100 += 1
  i500 += 1
print(ans)

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

Submission status: 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):
            #print(i,j,k)
            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())

res = 0

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

print(res)

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

Submission status: Accepted

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

count = 0

for ai in range(a+1):
  if 500 * ai > x:
    break
  for bi in range(b+1):
    if 500 * ai + 100 * bi > x:
      break
    for ci in range(c+1):
      if 500*ai + 100 * bi + 50 * ci == x:
        count += 1
      if 500*ai + 100 * bi + 50 * ci > x:
        break

print(count)

Submission status: Accepted

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

money = x
cmp = 0

for i in range(0,a+1,1):
  if money < 500*i:
    break
    
  for j in range(0,b+1,1):
    if money - 500*i < 100 * j:
      break
    
    for k in range(0,c+1,1):
      if money - 500*i - 100 * j < 50 * k:
        break
        
      if money == 500*i + 100 * j + 50 * k:
        cmp +=1
        #print(i,j,k)
    
print(cmp)

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 X == 500*a + 100*b + 50*c:
                ans += 1
            else:
                continue
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):
        y = x - i * 500 - j * 100
        if y % 50 == 0 and y // 50 <= c and y >= 0:
            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:
yen500 = int(input())
yen100 = int(input())
yen50 = int(input())
to = int(input())

res = 0

for i in range(yen500 + 1):
    if i * 500 > to:
        break
    for j in range(yen100 + 1):
        if 500 * i + 100 * j > to:
            break
        for k in range(yen50 + 1):
            if i*500 + j*100 + k*50 == to:
                res += 1
                break

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def combination(A, B, C, X):
    x = X/50
    
    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 == x:
                    count += 1
    return count
        
if __name__ == '__main__':
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    print(combination(A, B, C, X))

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

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

Submission status: Accepted

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 x == 500 * ai + 100 * bi + 50 *ci:
                count += 1
print(count)

Submission status: Accepted

Solution code:
count_500 = int(input())
count_100 = int(input())
count_50 = 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: Accepted

Solution code:
a,b,c,d = map(int,[input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if 500 * i + 100 * j + 50 * n == d:
                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):  #500円玉の枚数を変化
    for j in range(b + 1):  #100円玉の枚数を変化
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                count += 1

print(count)

Submission status: Accepted

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

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

ans = 0
for a in range(min(A+1, X//500 + 1)):
    for b in range(min(B+1, (X - 500*a)//100 + 1)):
        tmp = X - 500 * a - 100 * b
        if tmp % 50 == 0 and tmp >= 0 and tmp <= 50 * C:
            ans += 1

print(ans)

Submission status: Accepted

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

i=0


result=0

while i<=a:
  j=0
  while j<=b:
    k=0
    while k<=c:
     # print(i*500+j*100+k*50)
      if i*500+j*100+k*50==x:
        result=result+1
      k=k+1
    j=j+1
  i=i+1

print(result)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
A = int(input())
B = int(input())
C = int(input())
X = int(input())
memo = np.zeros(3).reshape(1,3)

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 :
                result = np.array([i,j,k])
                memo = np.vstack([memo,result])

print(len(memo[1:]))

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

Solution code:
#入力を受け取る
A = int(input()) #500円玉の枚数
B = int(input()) #100円玉の枚数
C = int(input()) #50円玉の枚数
X = int(input()) #合計金額

#通り数をインクリメントさせる変数
pattern = 0

#A,B,Cそれぞれ最大までfor文で3重に回す
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:
                pattern += 1

print(pattern)

Submission status: Accepted

Solution code:
a,b,c,x=[int(input())for _ in[0]*4];print(sum([(i)*10+(j)*2+(k)*1==x/50 for i in range(a+1)for j in range(b+1)for k in range(c+1)]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A_max = int(X / 500) if int(X / 500) <= A else A
B_max = 0
C_max = 0
X_tmp_a = X
X_tmp_b = X
count = 0

for a in range(A_max + 1):
    X_tmp_a = X - 500 * a
    B_max = int(X_tmp_a / 100) if int(X_tmp_a / 100) <= B else B
    for b in range(B_max + 1):
        X_tmp_b = X_tmp_a - 100 * b
        if int(X_tmp_b / 50) <= C:
            C_max = int(X_tmp_b / 50)
            count += 1

print(count)

Submission status: Accepted

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

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,b,c,x=[int(input()) for i in range(4)]

print(len([1 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]))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
import sys

c500, c100, c50, x = [int(v) for v in sys.stdin.read().splitlines()]
count = 0
for i in range(c500+1):
  for j in range(c100+1):
    for k in range(c50+1):
      if 500 * i + 100 * j + 50 * k == x:
        count += 1
print(count)

Submission status: Accepted

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

count = 0
for num_x in range(int(x/10) + 1):
    if num_x > a:
        break
    x1 = x - 10*num_x
    for num_ii in range(int(x1/2) + 1):
        if num_ii > b:
            break
        num_i = x1 - 2*num_ii
        if num_i <= c:
            count += 1

print(count)

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

print(res)

Submission status: Accepted

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
  for j in range(maxB + 1):
    q,mod = divmod (X - 500 * i - 100 * j ,50)
    if mod == 0 and q <= C:count += 1    
print(count)

Submission status: Accepted

Solution code:
def solve():
    a, b, c, x = read()
    result = think(a, b, c, x)
    write(result)


def read():
    a = read_int(1)[0]
    b = read_int(1)[0]
    c = read_int(1)[0]
    x = read_int(1)[0]
    return a, b, c, x


def read_int(n):
    return list(map(int, read_line().split()[:n]))


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, c, x):
    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
    return count


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def main():
    A = int(input())  # 500円の枚数
    B = int(input())  # 100円の枚数
    C = int(input())  # 50円の枚数
    X = int(input())
    result = 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:
                    result += 1

    print(result)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print cnt

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i in range(0, A+1):
        for j in range(0, B+1):
                for k in range(0, C+1):
                        if int(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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,x = map(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())
counter = 0

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

        
print(counter)

Submission status: Accepted

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

comb = 0

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

Submission status: Accepted

Solution code:
num_500 = int(input())
num_100 = int(input())
num_50 = int(input())
target = int(input())
count = 0
for i in range(0,num_500+1,1):
    if(500*i > target):
        break
    for j in range(0,num_100+1,1):
        if(500*i+100*j>target):
            break
        for k in range(0,num_50+1,1):
            if(500*i+100*j+50*k > target):
                break
            if(500*i+100*j+50*k == target):
                count += 1
                break
print(count)

Submission status: Accepted

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

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

print(res)

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

print(count)

Submission status: Accepted

Solution code:
max_n500 = int(input())
max_n100 = int(input())
max_n50 = int(input())
target_amount = int(input())

count = 0
for n500 in range(max_n500 + 1):
    amount_500 = n500 * 500
    if amount_500 > target_amount:
        break
    for n100 in range(max_n100 + 1):
        amount_100 = n100 * 100
        amount_500_100 = amount_500 + amount_100
        if amount_500_100 > target_amount:
            break
        for n50 in range(max_n50 + 1):
            amount_50 = n50 * 50
            current_amount = amount_500_100 + amount_50
            if current_amount == target_amount:
                count += 1
print(count)

Submission status: Accepted

Solution code:
max_n500 = int(input())
max_n100 = int(input())
max_n50 = int(input())
amount = int(input())

count = 0
for n500 in range(max_n500 + 1):
    for n100 in range(max_n100 + 1):
        for n50 in range(max_n50 + 1):
            if n500 * 500 + n100 * 100 + n50 * 50 == amount:
                count += 1
print(count)

Submission status: Accepted

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

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

print(z)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
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:
def main():
    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):
                # print(500*i + 100*j + 50*k)
                if 500*i + 100*j + 50*k == x:
                    count += 1 

    print(count)

main()

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

Submission status: Accepted

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

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

print(d)

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

Submission status: Accepted

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


count=0

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

print(str(count))

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
coin = [int(input()) for i in range(3)]
X = int(input())
cnt = 0
for i in range(coin[0]+1):
    x = X
    x -= 500 * i
    y = x
    if x == 0:
        cnt += 1
        break
    for j in range(coin[1]+1):
        x = y
        x -= 100 * j
        z = x
        if x == 0:
            cnt += 1
            break
        for k in range(coin[2]+1):
            x = z
            x -= 50 * k
            if x == 0:
                cnt += 1
                break
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())

counter = 0

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

Submission status: Accepted

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

SUM=[]

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            sum = 500*i + 100*j + 50*k
            SUM.append(sum)

print(SUM.count(X))

Submission status: Accepted

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

R = min(C, X // 50)
if (X - 50 * R) % 100 != 0 and R > 0:
	R -= 1
Q = min(B, (X - 50 * R) // 100)
while (X - 50 * R - 100 * Q) % 500 != 0:
	if Q > 0:
		Q -= 1
	elif R > 1:
		R -= 2
	else:
		break
P = min(A, (X - 50 * R - 100 * Q) // 500)

if 500 * P + 100 * Q + 50 * R >= X:
	ans = 1
	
	while True:
		while True:
			if 50 * R >= 100 and Q < B:
				R -= 2
				Q += 1
				ans += 1
			else:
				break
	
		if 100 * Q + 50 * R >= 500 and P < A:
			P += 1
			R = min(C, (X - 500 * P) // 50)
			if (X - 50 * R) % 100 != 0 and R > 0:
				R -= 1
			Q = min(B, (X - 500 * P - 50 * R) // 100)
			ans += 1
		else:
			break

else:
	ans = 0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print result

Submission status: Accepted

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

print(ansCnt)

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

print(count)