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())
if ((A+B+C<1) or (A<0 or A>50) or (B<0 or B>50) or (C<0 or C>50) or (X<50 or X > 20000 or X%50!=0)):
    print("条件を満たしてください")
count = 0

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

print (count)

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):
            # それぞれのコイン枚数に応じた合計額とXを比べる
            if i * 500 + j * 100 + k * 50 == X:
                ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(l[2]+1):
    for j in range(l[1]+1):
        for k in range(l[0]+1):
            b = 50 * i + 100 * j 
            b += 500 * k 
            if b == l[3] :
                a += 1
                 
print('{}'.format(a))

Submission status: Accepted

Solution code:

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

number_of_combination = 0


for k in range(0,A+1):
    number_of_a = k
    for j in range(0,B+1):
        number_of_b = j
        for i in range(0,C+1):
            number_of_c = i
            sum = 500*number_of_a + 100*number_of_b + 50*number_of_c
            if sum == X:
                number_of_combination += 1

print(number_of_combination)

Submission status: Accepted

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

i = 0
j = 0
k = 0
res = 0
cnt = 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):
                cnt = 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):
            summy = 500*i + 100*j + 50*k
            if summy == X:
                count = count + 1

print(count)

Submission status: Accepted

Solution code:
A, B, C, X = [int(input()) for _ in range(4)]
ans = 0
for a in range(A + 1):
    if X < 500 * a:
        break
    for b in range(B + 1):
        remainder = X - 500 * a - 100 * b
        if remainder < 0:
            break
        if remainder // 50 > C:
            continue
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def num_2n(i):
    count = 0
    while(i % 2 == 0):
        i = i / 2
        count += 1
    return count


def main():
    num_a = int(input())
    num_b = int(input())
    num_c = int(input())
    num_x = int(input())
    count = 0
    for in_a in range(num_a + 1):
        for in_b in range(num_b + 1):
            for in_c in range(num_c + 1):
                if num_x == in_a * 500 + in_b * 100 + in_c * 50: count += 1 
    print(count)

    
    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import product

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

ans = 0
for i, j, k in product(range(A + 1), range(B + 1), 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 d in range(A +1):
    for e in range(B+ 1):
        for f in range(C+1):
            if d* 500 + e* 100 + f*50 == X:
                count = count + 1
print(int(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 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 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:
input_lines = 4
coin_list = []
for i in range(input_lines):
  s = int(input())
  coin_list.append(s)
# print(coin_list)

def calc(coin_list, total = 0, count = 0):
    yen_500 = coin_list[0]
    yen_100 = coin_list[1]
    yen_50 = coin_list[2]
    total_yen = coin_list[3]

    for i in range(yen_500+1):
        for j in range(yen_100+1):
            for k in range(yen_50+1):
                if 500 * i + 100 * j + 50 * k == total_yen:
                    count += 1
    return count

calcurate = calc(coin_list)
print(calcurate)

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


print(cnt)

Submission status: Accepted

Solution code:
A = int(input()) # 500円
B = int(input()) # 100円
C = int(input()) # 50円
X = int(input()) # 合計

price = [500, 100, 50]
count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if price[0]*i + price[1]*j + price[2]*k == X:
                count+= 1
print(count)

Submission status: Accepted

Solution code:
# coding:utf-8

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

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def sum_price(i, j, k):
    return i*500 + j*100 + k*50


if __name__ == '__main__':
    li = []
    for i in range(4):
        li.append(int(input()))

    goal_price = li[3]
    cnt = 0
    for i in range(li[0]+1):
        for j in range(li[1]+1):
            for k in range(li[2]+1):
                if sum_price(i, j, k) == goal_price:
                    cnt += 1

    ans = cnt
    print(ans)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
a,b,c,x=[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())/50
#10a+2b+c=x
i=0
aam=int(x//10)
if aam > a:
    aam=a
for aa in range(aam+1):
    y=x-10*aa
    bbm=y//2

    if bbm > b:
        bbm=b
        #y-2bb>c NG
    for bb in range(int(bbm)+1):
    	if y-2*bb<=c:
        	i+=1
print(int(i))

Submission status: Accepted

Solution code:
fh_num = int(input())
oh_num = int(input())
fif_num = int(input())
sum = int(input())

i = 0
j = 0
t = 0
all = 0
count = 0

for i in range(fh_num + 1):
  for j in range(oh_num + 1):
    for t in range(fif_num + 1):
      all = 50 * t + 100 * j + 500 * i
      if all == sum:
        count += 1
      all = 0

print(int(count))

Submission status: Accepted

Solution code:
yen500 = int(input(''))
yen100 = int(input(''))
yen50 = int(input(''))
total = int(input(''))
count = 0
for x in range(yen500 + 1):
  for y in range(yen100 + 1):
    for z in range(yen50 + 1):
      if 500 * x + 100 * y + 50 * z == total:
        count += 1

print(count)

Submission status: Accepted

Solution code:
num = [int(input()) for i in range(3)]

total = [500*a+100*b+50*c for a in range(num[0]+1) for b in range(num[1]+1) for c in range(num[2]+1)]
print(total.count(int(input())))

Submission status: Accepted

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

for na in range(a+1):
     for nb in range(b+1):
        for nc in range(c+1):
            if x == 500 * na + 100 * nb + 50 * nc: 
                variation += 1

print(variation)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
five = int(input()) +1
one = int(input()) +1
fifty = int(input()) +1
target = int(input())
score = 0

for i in range(five):
    if(i*500 > target):
        break
    for j in range(one):
        if (i*500+j*100 > target):
            break
        for k in range(fifty):
            if(i*500+j*100+k*50 == target):
                score += 1
print(score)

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

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

Submission status: Accepted

Solution code:
l = [int(raw_input()) for _ in range(3)]
x = int(raw_input())
ct = 0
for i in range(l[0]+1):
  for j in range(l[1]+1):
    for k in range(l[2]+1):
      if i * 500 + j * 100 + k * 50 == x:
        ct += 1
print ct

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=int(input().strip())
B=int(input().strip())
C=int(input().strip())
X=int(input().strip())
ct=0
for a in range(A+1):
    for b in range(B+1):
        rest=X-(a*500+b*100)
        if rest>=0 and rest/50<=C:
            ct+=1
print(ct)

Submission status: Accepted

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

#コインの個数
num = 0

for i in range(A+1):
    for j in range(B+1):
        for q in range(C+1):
            if i*500 + j*100 + q*50 == X:
                num += 1
print(num)

Submission status: Accepted

Solution code:
a = int(input()) #500
b = int(input()) #100
c = int(input()) #50
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
            elif(500 * i + 100 * j + 50 * k > x):
                break
            # print("500:%d 100:%d 50:%d [%d]" %(i,j,k,cnt))
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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, x = [int(input()) for i in range(4)]
ans = 0
# a:500, b:100, c:50
 
for i_a in range(a+1):
    for i_b in range(b+1):
        for i_c in range(c+1):
            money = i_a*500 + i_b*100 + i_c*50
            if x == money:
                ans += 1
print(ans)

Submission status: Accepted

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

for i_a in range(a+1):
    for i_b in range(b+1):
        for i_c in range(c+1):
            money = i_a*500 + i_b*100 + i_c*50
            if x == money:
                ans += 1
print(ans)

Submission status: Accepted

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

X = int(input())
res = 0
for i_a in range(0, A+1):
    for i_b in range(0, B+1):
        for i_c in range(0, C+1):
            money = 500 * i_a + 100 * i_b + 50 * i_c
            if money == X:
                res += 1
print(res)

Submission status: Accepted

Solution code:
A,B,C,X = [int(input()) for i in range(4)]
ans = 0
for i_500 in range(A+1):
    for i_100 in range(B+1):
        resid = X - i_500 * 500 - i_100 * 100
        if resid >= 0:
            q,mod = divmod(resid,50)
            if C >= q and mod == 0:
                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):
    y = x-(500*i)
    for j in range(b+1):
        z = y-(100*j)
        for k in range(c+1):
            ans = z-(50*k)
            if ans==0:
                count = count+1

print(count)

Submission status: Accepted

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

# 入力
A = int(input())
B = int(input())
C = int(input())
X = int(input())
    
# 処理
cnt = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 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 500*i+100*j+50*k==X:
                count+=1
print(count)

Submission status: Accepted

Solution code:
import bisect
a, b, c, x = map(int, [input() for i in range(4)])
clist = [50*i for i in range(c+1)]
ans = 0
for i in range(a+1):
  for j in range(b+1):
    y = x-i*500-j*100
    insert_index = bisect.bisect_left(clist, y)
    if  insert_index < len(clist):
      if y == clist[insert_index]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a=int(raw_input())
b=int(raw_input())
c=int(raw_input())
x=int(raw_input())
op=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:
				op=op+1
				
print op

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_input())

def run():
 if x % 50 != 0 or a*500 + b*100 + c*50 < x:
  return 0

 #greedy
 an = 0
 bn = 0
 cn = 0
 
 xa = x
 while xa >= 500:
  xa -= 500
  an += 1
 while xa >= 100:
  xa -= 100
  bn += 1
 while xa >= 50:
  xa -= 50
  cn += 1
 if xa != 0:
  return 0 #wtf?
 
 ret = 0
 while an >= 0:
  if an <= a and bn <= b and cn <= c:
   ret += 1
  if bn > 0:
   bn -= 1
   cn += 2
  else:
   an -= 1
   bn = 5 + (cn / 2)
   cn = cn % 2
 return ret
print run()

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

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 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:
abc = [int(input()) for x in range(3)]
x = int(input())
cnt = 0
for i in range(abc[0]+1):
    for j in range(abc[1]+1):
        for k in range(abc[2]+1):
            func = 500*i+100*j+50*k
            if func == x : cnt += 1
            else: continue
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

for a_i in range(0, a + 1):
    if a_i * 500 > x:
        break
    for b_i in range(0, b + 1):
        for c_i in range(0, c + 1):
            if a_i * 500 + b_i * 100 + c_i * 50 == x:
                count += 1

print(count)

Submission status: Accepted

Solution code:
a0 = int(input())   #500円玉
b0 = int(input())   #100円玉
c0 = int(input())   # 50円玉
x = int(input())   #合計金額

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

    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 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:
# -*- coding: utf-8 -*-

c_500 = int(input())
c_100 = int(input())
c_50 = int(input())
how = int(input())

count = 0
for i in range(c_500 + 1):
    for j in range(c_100 + 1):
        for k in range(c_50 + 1):
            if i*500 + j*100 + k*50 == how:
                count += 1
print(count)

Submission status: Accepted

Solution code:
def get_coin_comb(A, B, C, X):
    count = 0
    for i in range(A+1):
        for j in range(B+1):
            for k in range(C+1):
                sumv = 500*i + 100*j + 50*k
                if sumv == X:
                    count += 1
    return count


if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    print(get_coin_comb(a, b, c, x))

Submission status: Accepted

Solution code:

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

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

print(num)

Submission status: Accepted

Solution code:
from itertools import product
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = [0 for i in range(4)]

for i in range(4):
    num[i] = int(input())

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

print(count)

Submission status: Accepted

Solution code:
import math

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


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

print(total)

Submission status: Accepted

Solution code:
# A: 500, b: 100, c: 50, X: sum
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0

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

print(counter)

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()


#100円
a = int(arr_data[0][0])

#50円
b = int(arr_data[1][0])

#10円
c = int(arr_data[2][0])

#合計
x = int(arr_data[3][0])


mycnt=0


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

Submission status: Accepted

Solution code:
A, B, C, x = map(int, [input() for i in range(4)])
ans = [ a 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 ]
print(len(ans))

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for a_n in range(a+1):
    for b_n in range(b+1):
        for c_n in range(c+1):
            if a_n * 500 + b_n * 100 + c_n * 50 == x:
                count += 1

print(count)

Submission status: Accepted

Solution code:
a, b, c, x = map(int, [input() for i in range(4)])
ans = [ a 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 ]
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

count = 0
for a in range(s[0] + 1):
    for b in range(s[1] + 1):
        for c in range(s[2] + 1):
            if( a*500 + b*100 + c*50 == s[3] ):
                count = count + 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

ans = 0

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

            if sum == x:
                ans += 1
            elif sum > x:
                break;


print(ans)