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(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:
# input
A = int(input())
B = int(input())
C = int(input())
X = int(input())

# check
if X % 100 == 50 and C == 0:
    print(0)
else:
    all_case = len(
        [
            1
            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
        ]
    )

    print(all_case)

Submission status: Accepted

Solution code:
A500 = int(input())
B100 = int(input())
C50 = int(input())
X = int(input())

c = 0
for i in range(A500+1):
  for j in range(B100+1):
    for k in range(C50+1):
      if X == i*500 + j* 100 + k*50:
        c+=1
print(c)

Submission status: Accepted

Solution code:
A = int(input()) #500円玉
B = int(input()) #100円玉
C = int(input()) #50円玉
X = int(input()) #この値にする合計を求める

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X // 500
b = (X - 500*a) // 100
c = (X - 500*a - 100*b) //50 

count = 0
i = a 
while i >= 0:
  j = b
  k = c
  while j >= 0:
    if i <= A and j <= B and k <= C:
      count += 1 
    j -= 1
    k += 2
  i -= 1
  b += 5
  
print(count)

Submission status: Accepted

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

if not (0 <= A <= 50 and 0 <= B <= 50 and 0 <= C <= 50):
    sys.exit()
if not ( 1 <= A + B + C ):
    sys.exit()
if not ( 50 <= X <= 20000 ):
    sys.exit()
if X % 50 != 0:
    sys.exit()

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:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

A = iIn()
B = iIn()
C = iIn()
X = iIn()

# めんどくさいから全探索
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:
def actual(A, B, C, X):
    count = 0

    for n_500yen in range(A + 1):
        for n_100yen in range(B + 1):
            for n_050yen in range(C + 1):
                amount = 500 * n_500yen + 100 * n_100yen + 50 * n_050yen

                if amount == X:
                    count += 1

    return count

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

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

Submission status: Accepted

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

cnt = 0
for i500 in range(a+1):
  for i100 in range(b+1):
    for i50 in range(c+1):
      total = (i500*500) + (i100*100) + (i50*50)
      if total == 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())

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

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#
# Author: Tetsuya Ishikawa <tiskw111@gmail.com>
# Date  : June 30, 2020
##################################################### SOURCE START #####################################################

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

count = 0

if X % 50 != 0:
    print(0)

else:

    Y = X // 50

    for a in range(A + 1):
        for b in range(B + 1):
            c = Y - 10 * a - 2 * b
            if 0 <= c <= C:
                count += 1

    print(count)

##################################################### SOURCE FINISH ####################################################
# vim: expandtab tabstop=4 shiftwidth=4 fdm=marker

Submission status: Accepted

Solution code:
import itertools

a = int(input())
b = int(input())
c = int(input())
x = int(input())
y = x//50

p = 0

list_s = list(range(a+1))
list_t = list(range(b+1))
list_u = list(range(c+1))

for s,t,u in itertools.product(list_s,list_t,list_u):
    m = 10*s + 2*t + u
    if m == y:
        p += 1

print(p)

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,d = map(int,open(0))
print(sum(500*i+100*j+50*k==d for i in range(a+1) for j in range(b+1) for k in range(c+1)))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a=int(input())#500
b=int(input())#100
c=int(input())#50
n=int(input())
co=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      go=500*i+100*j+50*k
      if go==n:
        co+=1
print(co)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
x_dash=x//50
cnt=0
for i in range(0,a+1):
  for j in range(0,b+1):
    k=x_dash-10*i-2*j
    if 0<=k<=c:
      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 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())
counts = 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:
                counts += 1
print(counts)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
sums = []
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            sums.append(i*500+j*100+k*50)
print(sums.count(X))

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
X=int(int(input())//50)
count=0
for i in range(A+1):
  for j in range(B+1):
    rest=X-i*10-j*2
    if rest>=0 and rest-C<=0:
      count=count+1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
a,b,c = [int(input()) for i in range(3)]
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:
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())

k = 0
for a in range(min([A, X // 500]) + 1):
    Y = X - 500 * a
    for b in range(min([B, Y // 100]) + 1):
        k += (Y - 100 * b) // 50 <= C

print(k)

Submission status: Accepted

Solution code:
A, B, C, X = [int(input()) for _ in range(4)]
res = 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:
                res += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
for a in range(0, A+1):
    for b in range(0, B+1):
        for c in range(0, C+1):
            if X == a*500+b*100+c*50:
                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())
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:
from sys import stdin
data = stdin.read().splitlines()

a = int(data[0])
b = int(data[1])
c = int(data[2])
x = int(data[3])

count = 0

l = min(x//500, a)

while l >= 0:
    x = x - 500*l
    m = min(x//100, b)
    while m >= 0:
        x = x - 100*m
        if c >= x//50:
            count += 1
        x = x + 100*m
        m -= 1
    x = x + 500*l
    l -= 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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C, X = (int(input()) for i in range(4))
res = 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): res += 1
print(res)

Submission status: Accepted

Solution code:
#Coins
a = int(input()) #500円玉
b = int(input()) #100円玉
c = int(input()) #50円玉
x = int(input()) #総額
#硬貨の選び方は何通りあるか
count = 0
for i in range(0,a+1):
  y = x - 500 * i
  if y < 0:
    break
  for j in range(0,b+1):
    z = y - 100 * j
    if z < 0:
      break
    elif (z / 50) <= c:
      count += 1
print(count)

Submission status: Accepted

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

wayCount = 0

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

for l in range(a + 1):
    for m in range(b + 1):
        for n in range(c + 1):
            s = 500 * l + 100 * m + 50 * n
            if s == 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):
    ayen=i*500
    if ayen<=x:
        for j in range(b+1):
            byen=j*100
            if ayen+byen<=x:
                extra=x-ayen-byen
                if extra<=c*50:
                    cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, x = int(input()), int(input()), int(input()), int(input())
count = 0
for i in range(a + 1):
  p = x - i * 500
  if p < 0 :
    continue
  elif p == 0:
    count += 1
    continue
  for j in range(b + 1):
    q = p - j * 100
    if q < 0 :
      continue
    elif q == 0:
      count += 1
      continue
    for k in range(c + 1):      
      if q - k * 50 == 0 :
        count += 1
      else:
        continue
      
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):
    aa = 500*i
    for j in range(b+1):
        bb = 100*j
        for k in range(c+1):
            cc = 50*k
            if aa+ bb+ cc ==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(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 itertools
A = int(input())
B = int(input())
C = int(input())
X = int(input())

a = list(range(0,A+1))
b = list(range(0,B+1))
c = list(range(0,C+1))

fifty = X/50
ans = 0

for i in itertools.product(a, b, c):
    if 10*i[0]+2*i[1]+i[2] == fifty:
        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 X == 500*i + 100*j + 50*k:
                count += 1

print(count)

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

Submission status: Accepted

Solution code:
import itertools

def main():
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())
    a = [x for x in range(A+1)]
    b = [x for x in range(B+1)]
    c = [x for x in range(C+1)]
    ans = 0
    for i,j,k in itertools.product(a,b,c):
        if X == 500*i + 100*j + 50*k:
            ans += 1
    print(ans)

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

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
"""
B - Coins
"""
#合計金額の通り数 kaisu
kaisu = 0

# 500円玉の枚数 a
a = int(input())

# 100円玉の枚数 b
b = int(input())

# 50円玉の枚数 c
c = int(input())

# 合計金額 x
x = int(input())

#入力のチェック
#print(a, b, c, x)

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

print(kaisu)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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(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)

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

print(count)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
p = 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:
                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 k in range(c + 1):
            if x == 500 * i + 100 * j + 50 * k:
                count += 1
print(count)

Submission status: Accepted

Solution code:
# coding-utf8 #

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

# 全探索
# 全部0枚から初めてそれぞれの硬貨枚数までインクリメントしていって、
# ちょうどx円になるものを探す

count = 0

for i_500 in range(a + 1):
  for i_100 in range(b + 1):
    for i_50 in range(c + 1):
      sum = 500 * i_500 + 100 * i_100  + 50 * i_50
      if sum == x:
        count += 1

print(count)

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

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):
            if 0<=X//50-10*i-2*j<=C:
                cnt+=1
    print(cnt)
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math
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)]

"""
aが500円
bが100円
cが50円
"""
flag = 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:
                flag += 1
print(flag)

Submission status: Accepted

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

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

amount = int(input())

count = 0
for i in range(a+1):
    for j in range(b+1):
        temp = amount - (500*i + 100*j)
        
        if temp < 0:
            continue
        elif temp%50!=0:
            continue
        elif c < temp//50:
            continue
        # print(temp)
        count+=1
print(count)

Submission status: Accepted

Solution code:
a, b, c, x  = [int(input()) for _ in range(4)]
x //= 50
ans = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            p = 10 * i + 2 * j + k
            if p == 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 += 1
print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
# 複数個格納
# A B = map(int, input().split())
# 行列化
# A = np.array(A)
# A=A.reshape(1,-1)
# A=A.T
#行列の比較
#C=((A%2 == vector0).all())


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

gohyaku=(np.arange(0,500*A+1,500)).reshape(1,-1)
hyaku=(np.arange(0,100*B+1,100)).reshape(1,-1)
goju=(np.arange(0,50*C+1,50)).reshape(1,-1)


gohyaku1=X-(gohyaku+hyaku.T)
count=0
for i in range(A+1):
    for k in range(B+1):
        if 0 <= gohyaku1[k,i] <= C*50:
            count=count+1

print(count)

Submission status: Accepted

Solution code:
a=int(input()) #50*10*a
b=int(input()) #50*2*b
c=int(input()) #50*1*c
x=int(input())

#xは50の何倍？？
m=x//50
count=0
#m=10*a+2*b+cなる整数a,b,cの組

for i in range(0,a+1):
    for j in range(0,b+1):
        for k in range(0,c+1):
            if 10*i+2*j+k==m:
                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)