Problem:


Score : 200 points

Problem Statement

You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?

Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Constraints

0 \leq A, B, C \leq 50

A + B + C \geq 1

50 \leq X \leq 20 000

A, B and C are integers.

X is a multiple of 50.

Input

Input is given from Standard Input in the following format:

A
B
C
X

Output

Print the number of ways to select coins.

Sample Input 1

2
2
2
100

Sample Output 1

2

There are two ways to satisfy the condition:

Select zero 500-yen coins, one 100-yen coin and zero 50-yen coins.

Select zero 500-yen coins, zero 100-yen coins and two 50-yen coins.

Sample Input 2

5
1
0
150

Sample Output 2

0

Note that the total must be exactly X yen.

Sample Input 3

30
40
50
6000

Sample Output 3

213



Sample input:
2
2
2
100


Sample output:
2

Submission status: Accepted

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

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            p = 500*i + 100*j + 50*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())
ans = 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:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            if 500*ai+100*bi+50*ci==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()) for i in range(4)]
ans = 0;
for i in range(a[0]+1):
    for j in range(a[1]+1):
        for k in range(a[2]+1):
            b = i * 500 + j * 100 + k * 50
            if b == a[3]:
                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:
a,b,c,x = [int(input()) for _ in range(4)]
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 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())
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0

for i in range(0, coins[0] + 1):
  for j in range(0, coins[1] + 1):
    for k in range(0, coins[2] + 1):
      ans = 500*i + 100*j + 50*k
      if ans == coins[3]:
        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):
        nc = (x - 500*i - 100*j) // 50
        if nc < 0 or c < nc:
            continue
        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):
            price = 500 * i + 100 * j + 50 * k
            if price == x:
                ans += 1

print(ans)

Submission status: Accepted

Solution code:
def main():
    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):
                m = x
                m = m - 500*i - 100*j - 50*k
                if m == 0:
                    ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
s=[int(input()) for _ in range(4)]
g=min(s[3]//500,s[0])
h=min(s[3]//100,s[1])
j=s[2]
c=0
for a in range(g+1):
	for b in range(h+1):
		x=s[3]-500*a
		x-=100*b
		if x>=0 and x//50<=s[2]:
			c+=1
print(c)

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

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

cnt = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 10*a + 2*b + c == X:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    a = I()
    b = I()
    c = I()
    x = I()

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


if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import time


A = int(input())
B = int(input())
C = int(input())
X = int(input())
# t1 = time.time()
ans = 0

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

print(ans)
# t2 = time.time()
# print(t2-t1)

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc087/tasks/abc087_b
# Python 3rd Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
int1 = lambda x: int(x) - 1
intp1 = lambda x: int(x) + 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solver(yen500, yen100, yen050, objectSum):
    result = 0
    # algorithm
    for yen500v in range(0, intp1(yen500)):
        for yen100v in range(0, intp1(yen100)):
            for yen050v in range(0, intp1(yen050)):
                nowtotal = yen500v*500+yen100v*100+yen050v*50
                if nowtotal == objectSum:
                    result = intp1(result)
    return result


if __name__ == "__main__":
    A = II()
    B = II()
    C = II()
    X = II()
    print("{}".format(solver(A, B, C, X)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a = ni()
b = ni()
c = ni()
x = ni()
ans = 0

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

print(ans)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""

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

A_count=0
B_count=0
count=0

while X-(500*A_count)>=0:
    while X-(500*A_count)-(100*B_count)>=0:
        if (X-(500*A_count)-(100*B_count))/50<=C:
            count+=1
        B_count+=1
        if B_count>B:
            break
    A_count+=1
    if A_count>A:
        break
    B_count=0

print(count)

Submission status: Accepted

Solution code:
def main(a, b, c, x):

    def gen(coin, n_of_coins, x_parts):
        for x_part in x_parts:
            for i in range(n_of_coins + 1):
                new_x_part = x_part + coin * i
                if new_x_part <= x:
                    yield new_x_part

    x_maybe_iter = gen(50, c, gen(100, b, gen(500, a, [0])))
    patterns = sum(x_maybe == x for x_maybe in x_maybe_iter)
    return patterns


if __name__ == '__main__':
    a, b, c, x = [int(input()) for _ in range(4)]
    print(main(a, b, c, x))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

    print(correct)


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(0,A+1):
    for j in range(0,B+1):
      for k in range(0,C+1):
        value=i*500+j*100+k*50
        if value==X: count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
X = int(input())
cnt = 0

for i in range(a+1):
    for j in range(b+1):
        rem = X - 500*i - 100*j
        if rem < 0: continue
        if rem%50 == 0 and 50*(rem//50) == rem and rem//50 <= c:
            cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0

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

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 (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())
t=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/50:
        t+=1
print(t)

Submission status: Accepted

Solution code:
#ABC087B - Coins
"""全探索でいける？"""
a = int(input())#500
b = int(input())#100
c = int(input())#50
x = int(input())#金額
 
ans = 0
 
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == (i*500 + j*100 + k*50):
                ans += 1
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            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())
z = int(input())
l = [500*i+100*t+50*w for i in range(a+1) 
         for t in range(b+1) for w in range(c+1)]
print(l.count(z))

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

print(count)

Submission status: Accepted

Solution code:
# Problem
# Python 2nd Try
import sys


def solver(yen500, yen100, yen050, sumX):
    result = 0
    for j in range(0, yen500+1, +1):
        for k in range(0, yen100+1, +1):
            for m in range(0, yen050+1, +1):
                totalsum = j*500+k*100+m*50
                if sumX == totalsum:
                    result = result + 1
    return result


if __name__ == "__main__":
    A = int(sys.stdin.readline())
    B = int(sys.stdin.readline())
    C = int(sys.stdin.readline())
    X = int(sys.stdin.readline())
    # print(A, B, C, X, sep="\n")
    print("{}".format(solver(A, B, C, X)))

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
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())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m > x:
        break
      elif m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m1, m2, m3, p = 0, 0, 0, 0
while i1 <= a:
  m1 = 500 * i1
  while i2 <= b:
    m2 = m1 + 100 * i2
    while i3 <= c:
      m3 = m2 + 50 * i3
      if m3 < x:
        i3 += 1
        continue
      elif m3 > x:
        break
      else:
        p += 1
        break
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Submission status: Accepted

Solution code:
def main():
    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
            if tmp >= 0 and tmp//50 <= C:
                ans += 1 
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    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 h in range(C+1):
                if 500*i + 100*j + 50*h == X:
                    ans += 1    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
result = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):

            result = 500*i + 100*j + 50*k
            if x == result:
                count = count + 1

print(count)

Submission status: Accepted

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


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    cnt = 0

    for ia in range(a + 1):
        for ib in range(b + 1):
            for ic in range(c + 1):
                total = 500 * ia + 100 * ib + 50 * ic
                if total == 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())
ret = 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):
                ret += 1

print(ret)

Submission status: Accepted

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


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

print(ret)

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

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

print(t)

Submission status: Accepted

Solution code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())
count = 0
# 合計金額の全通り
for i in range(coin_500 + 1):
    for j in range(coin_100 + 1):
        for k in range(coin_50 + 1):
            if 500 * i + 100 * j + 50 * k == total:
                count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc087/tasks/abc087_b
# Python 1st Try


def solver(dataset):
    result = 0
    for yen500 in range(0, dataset[0]+1):
        for yen100 in range(0, dataset[1]+1):
            for yen050 in range(0, dataset[2]+1):
                sum = yen500*500+yen100*100+yen050*50
                if sum == dataset[3]:
                    result = result + 1
    return result


if __name__ == "__main__":
    datas = []
    for j in range(0, 4):
        datas.append(int(input()))
    print("{}".format(solver(datas)))

Submission status: Accepted

Solution code:
# coding:utf-8
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    total = 0
    count = 0

    for a_cont in range(a+1):
        for b_cont in range(b+1):
            for c_cont in range(c+1):
                total = (a_cont*500) + (b_cont*100) + (c_cont*50)
                if total == x:
                    count = count + 1

    print(count)


if __name__ == '__main__' :
    main()

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):
        tmp = X-500*i-100*j
        if tmp < 0:
            break
        if tmp%50==0 and tmp//50<=C:
            ans += 1
print(ans)

Submission status: Accepted

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

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

f(A,B,C,X)

Submission status: Accepted

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

print(sum(500*x+100*y+50*z==X for x in range(A+1) for y in range(B+1) for z in range(C+1)))

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:
# Author: cr4zjh0bp
# Created: Thu Mar 12 19:50:26 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

A, B, C, X = nin(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())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
y500_max = int(input())
y100_max = int(input())
y50_max = int(input())
sum = int(input())
patterns = [[ y500, y100, y50 ] for y500 in range(y500_max + 1) 
                                              for y100 in range(y100_max + 1) 
                                              for y50 in range(y50_max + 1)
                                              if y500 * 500 + y100 * 100 + y50 * 50 == sum]
print(len(patterns))

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

Submission status: Accepted

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

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