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:
# -*- coding: utf-8 -*-

a=int(input()) #500
b=int(input()) #100
c=int(input()) #50
x=int(input()) #sum

cnt=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            tmp=500*i+100*j+50*k
            if tmp==x:
                cnt+=1
            elif tmp>x:
                break
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(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
i = 0
while i <= a:
    j = 0
    while j <= b:
        k = 0
        while k <= c:
            if 500 * i + 100 * j + 50 * k == x:
                count += 1
            k += 1
        j += 1
    i += 1
print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
a_coins = int(input())
b_coins = int(input())
c_coins = int(input())
num = int(input())

count = 0

for a in range(0, a_coins + 1):
    for b in range(0, b_coins + 1):
        for c in range(0, c_coins + 1):
            total =  a * 500 + b * 100 + c * 50
            if total == num:
                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):
            m = 500*i + 100*j + 50*k
            if m == x:
                count += 1
print(count)

Submission status: Accepted

Solution code:
five_hand = int(input())
one_hand = int(input())
fifty = int(input())
x = int(input())

count = 0

for i in range(five_hand+1):
    for j in range(one_hand+1):
        for k in range(fifty+1):
            res = 500*i + 100*j + 50*k
            if x == res:
                count += 1

print(count)

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

Submission status: Accepted

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

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

i = 0

for a in range(A+1):
    if (a * 500) == X:
        i += 1
        break

    for b in range(B+1):
        if (a * 500) + (b * 100) == X:
            i += 1
            break

        for c in range(C+1):
            if (a * 500) + (b * 100) + (c * 50)== X:
                i += 1
                break

print(i)

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

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = INT()
B = INT()
C = INT()
X = INT()

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- 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):
            if 500*i + 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())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        tmp = (x-((500*i)+(100*j)))
#        print (i,j,tmp)
        if tmp == 0:
            ans += 1
        elif tmp > 0:
            if tmp%50 == 0 and tmp//50 <= c:
                ans += 1
        else:
            # tmp < 0
            pass            
print (ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
count = 0
sum = 0
tempa = 0
tempb = 0
tempc = 0
 
while tempa <= a:
  while tempb <= b:
    while tempc <= c:
      sum = tempa * 500 + tempb * 100 + tempc * 50
      if sum == x:
        count = count + 1
      tempc = tempc + 1
    tempc = 0
    tempb = tempb + 1
  tempb = 0
  tempa = tempa + 1
 
print(count)

Submission status: Accepted

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

def main():
    # 整数の入力
    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):
                v = 500 * i + 100 * j + 50 * k
                if v == x:
                    cnt += 1

    print(cnt)


main()

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 x == 500*i + 100*j + 50*k:
                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(c+1):
    for j in range(b+1):
        for k in range(a+1):
            if k*500+j*100+i*50 == 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 cnt_500 in range(a + 1):
    for cnt_100 in range(b + 1):
        for cnt_50 in range(c + 1):
            price = 500 * cnt_500 + 100 * cnt_100 + 50 * cnt_50
            if price == x:
                cnt += 1
print(cnt)

Submission status: Accepted

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

counter = 0
calc_x = 0

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

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:
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:
#500円玉の数
a = int(input())
#100円玉の数
b = int(input())
#50円玉の数
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 == 0:
                count += 1
                

print(count)

Submission status: Accepted

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

can = []

for num_A in range(A + 1):
    for num_B in range(B + 1):
        for num_C in range(C + 1):
            num = 500 * num_A + 100 * num_B + 50 * num_C
            can.append(num)

print(can.count(X))

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(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())
S = int(input())
Ans = 0

for i in range(A+1):
    A500 = 500 * i
    for j in range(B+1):
        B100 = 100 * j
        for k in range(C+1):
            C50 = 50 * k
            if (A500+B100+C50) == S:
                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):
        for k in range(C+1):
            
            if i*500+j*100+k*50==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 a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      Y = 500*a + 100*b + 50*c
      if X == Y:
        ans += 1
print(ans)

Submission status: Accepted

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

cnt = 0

for a in range(int(X/500)+1):
  if a <= A:
    for b in range(int((X-a*500)/100)+1):
      if b <= B:
        if a+b+int((X-a*500-b*100)/50) >= 1 and int((X-a*500-b*100)/50) <= C:
          cnt = cnt + 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
#  A,B = map(int, input().split())
  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 X == 500*a + 100*b + 50*c:
          count += 1
  print(count)
          
if __name__ == "__main__":
  main()

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
def resolve():
    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)
resolve()

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 500*A+100*B+50*C==x:
                count+=1
print(count)

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(3)]
b=int(input())
c,ans=[],0
for k in range(a[0]+1):
    for i in range(a[1]+1):
        for j in range(a[2]+1):
            c.append(500*k+100*i+50*j)
for l in range(len(c)):
    if c[l]==b:
        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 = 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)]
print([500*a+100*b+50*c for a in range(A+1) for b in range(B+1) for c in range(C+1)].count(X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C, X = [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 = 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):
      total = 500*i + 100*j + 50*k
      if total == X:
        ans += 1

print(ans)

Submission status: Accepted

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

rCnt = 0
ttla = 0
ttlb = 0

ia = 0

while ia <= a:
  ib = 0
  ic = 0
  ttla = 500 * ia
  ia = ia + 1
  while ib <= b:
    ic = 0
    ttlb = 100 * ib
    ib = ib + 1
    while ic <= c:
      if x == ttla + ttlb + 50 * ic:
        rCnt = rCnt + 1
      ic = ic + 1

print(rCnt)

Submission status: Accepted

Solution code:
a,b,c,x=map(int,open(0).read().split())
t=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:
        t+=1
print(t)

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=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 = 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):
        c = (X-500*i-100*j)//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())

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

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):
    S=500*i+100*j
    if S>X:
      break
    #print(i,j,(X-S)/50)
    if (X-S)%50==0 and (X-S)/50<=C:
      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(X//500+1):
    #500円玉が足りなければ終了
    if A<i:
        break
    #500円玉をi枚使った残りの金額(X%(500*i)円)を、100円玉と50円玉に割り振る
    for j in range((X-500*i)//100+1):
        if B<j:
            break
        if C>=(X-(500*i)-(100*j))//50:
            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):
        for k in range(c+1):
            if i * 500 + j * 100 + 50 * k == x:
                cnt += 1
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(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()) / 50

count = 0
for i in range(a + 1):
    for j in range(b + 1):
        t = x - 10 * i - 2 * j
        if t <= c and 0 <= t:
            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):
            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())

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A = int(readline())
    B = int(readline())
    C = int(readline())
    X = int(readline())
    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)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]
## math
DIVC = lambda x, y: -(-x//y)
DIVF = lambda x, y: x//y

def main():
    a,b,c,x = [II() for _ in range(4)]
    cnt = 0
    for i in range(a+1):
        for j in range(b+1):
            k = (x-(i*500+j*100))//50
            if 0 <= k <= c: cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]
## math
DIVC = lambda x, y: -(-x//y)
DIVF = lambda x, y: x//y

def main():
    a,b,c,x = [II() for _ in range(4)]
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B,C,X=map(int,open(0))
ans=0

i=0
while i<=C:
    j=0
    while j<=B:
        k=0
        while k<=A:
            ans+=1*(500*k+100*j+50*i==X)
            k+=1
        j+=1
    i+=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):
            res = 500 * i + 100 * j + 50 * k
            if res == 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 ((500*a)+(100*b)+(50*c))==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):
            if 500*i+100*j+50*k == X:
                count += 1
print(count)

Submission status: Accepted

Solution code:
def myAnswer(A:int,B:int,C:int,X:int) -> int:
   counter = 0
   for a in range(0,A+1):
      a *= 500
      for b in range(0,B + 1):
         b *= 100
         for c in range(0,C + 1):
            if(a + b + c*50 == X):
               counter += 1
   return counter


def modelAnswer():
   tmp=1
def main():
   A = int(input())
   B = int(input())
   C = int(input())
   X = int(input())
   print(myAnswer(A,B,C,X))

if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
A, B, C, X = [int(input()) for i in range(4)]
count = 0
for i in range(0, A+1):
    for k in range(0, B+1):
        for l in range(0, C+1):
            if 500*i + 100*k + 50*l == 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):
      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())

num_case = 0

for i in range(A+1) :
	A_sum = 500 * i
	if A_sum > X :
		break
	for j in range(B+1) :
		AB_sum = A_sum + 100 * j
		if AB_sum > X :
			break
		for k in range(C+1) :
			ABC_sum = AB_sum + 50 * k
			if ABC_sum == X :
				num_case += 1
				break
			elif ABC_sum > X :
				break
print(num_case)

Submission status: Accepted

Solution code:
from sys import stdin

a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
c = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
x_500_100_50 = x

total=0


## 500
for i in range(0, a+1):
    if i * 500 > x_500_100_50:
        break
    #if i * 500 == x_500_100_50:
    #    total = total + 1
    x_100_50 = x_500_100_50 - i * 500

    ## 100
    for j in range(0, b+1):
        if j * 100 > x_100_50:
            break
        #if j * 100 == x_100_50:
        #    total = total + 1
        x_50 = x_100_50 - j * 100

        ## 50
        for k in range(0, c+1):
            if k * 50 > x_50:
                break
            if k * 50 == x_50:
                total = total + 1
                #print("500: %d  100: %d  50: %d" % (i, j, k))

print(total)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, C, X = [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(X == 500 * a + 100 * b + 50 * c):
                count += 1
print(count)

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

Submission status: Accepted

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

s=0

for i in range(0,min(X//500,A)+1):
  Xi=X-i*500
  for j in range(0,min(Xi//100,B)+1):
    Xj=Xi-j*100
    if Xj<= C*50:
      s=s+1

print(s)

Submission status: Accepted

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

result = 0

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

print(result)

Submission status: Accepted

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

A_list = [500*i for i in range(A+1)]
B_list = [100*i for i in range(B+1)]
C_list = [50*i for i in range(C+1)]

result = 0

for i in A_list:
    for j in B_list:
        i_j = i + j
        for k in C_list:
            if i_j + k == X:
                result += 1

print(result)

Submission status: Accepted

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

A_list = [500*i for i in range(A+1)]
B_list = [100*i for i in range(B+1)]
C_list = [50*i for i in range(C+1)]
sum_list = []

for i in A_list:
    for j in B_list:
        i_j = i + j
        for k in C_list:
            sum_list.append(i_j + k)

result = 0
for i in sum_list:
    if i == X:
        result += 1

print(result)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 数字の入力
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):
            sum = 500*i + 100*j + 50*k
            if sum == X:
                ans = ans+1
                #print(str(i)+" "+str(j)+" "+str(k)
                break
            elif sum > X:
                break

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import itertools

a,b,c,x=map(int,open(0).read().split())
a=[list(range(a+1)),list(range(b+1)),list(range(c+1))]
l=list(itertools.product(*a))
ans=list((a,b,c) for a,b,c in l if (a*500)+(b*100)+(c*50)==x)
print (len(ans))

Submission status: Accepted

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+1):
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x:
                count=count+1
            else:
              count=count
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:
a=int(input())
b=int(input())
c=int(input())
sum=int(input())
count=0
for x in range(a+1):
    for y in range(b+1):
        for z in range(c+1):
            if 500*x+100*y+50*z==sum:
                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 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 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:
        count += 1
print(count)