Problem:


Score : 100 points

Problem Statement

You went shopping to buy cakes and donuts with X yen (the currency of Japan).

First, you bought one cake for A yen at a cake shop.
Then, you bought as many donuts as possible for B yen each, at a donut shop.

How much do you have left after shopping?

Constraints

1 \leq A, B \leq 1 000

A + B \leq X \leq 10 000

X, A and B are integers.

Input

Input is given from Standard Input in the following format:

X
A
B

Output

Print the amount you have left after shopping.

Sample Input 1

1234
150
100

Sample Output 1

84

You have 1234 - 150 = 1084 yen left after buying a cake.
With this amount, you can buy 10 donuts, after which you have 84 yen left.

Sample Input 2

1000
108
108

Sample Output 2

28

Sample Input 3

579
123
456

Sample Output 3

0

Sample Input 4

7477
549
593

Sample Output 4

405



Sample input:
1234
150
100


Sample output:
84

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
n = a-b
print(n%c)

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
n = a-b
print(n%b)

Submission status: Runtime Error

Solution code:
x,a,b=map(int,raw_input().split())
print (x-a)%b

Submission status: Runtime Error

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: Runtime Error

Solution code:
import collections
from collections import deque
import sys
input = sys.stdin.readline
 
def bfs(s):
    d = deque()
    d.append(s)
    dis[s]=0
    flag=True
    while len(d):
        x = d.popleft()
        for i,j in vec[x]:
            if dis[i] == INF:
                dis[i]=dis[x]+j
                d.append(i)
 
            else:
                if dis[i]==dis[x]+j:
                    continue
                else:
                    print('No')
                    exit()
    return flag
 
 
n,m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
vec= [[] for i in range(n)]
 
for i in range(m):
    vec[a[i][0]-1].append((a[i][1]-1,a[i][2]))
    vec[a[i][1]-1].append((a[i][0]-1,-a[i][2]))
 
INF=float('inf')
dis=[INF]*n
 
for i in range(n):
    if dis[i]==INF:
        bfs(i)
print('Yes')

Submission status: Runtime Error

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

l=[]
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            l.append(500*i+100*j+50*k)
n=0
for i in range(len(l)):
    if l[i]==x:
        n+=1
print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

count = 0
a_ = X//500
if a_>A:
    a_ = A
for a in range(a_+1):
    x_ = X-a*500
    b_ = x_//100
    if b_>B:
        b_ = B
    for b in range(b_+1):
        x = x_-b*100
        c_ = x//50
        if c_<=C and c_>=0:
            count = count + 1

print(count)

Submission status: Runtime Error

Solution code:
x,a,b=[int(input) for i in range(3)]
ans=(x-a)%b
print(ans)

Submission status: Runtime Error

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: Runtime Error

Solution code:
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

int main() {
  int x, a, b;
  scanf("%d", &x);
  scanf("%d", &a);
  scanf("%d", &b);
  printf("%d\n", (x-a)%b);
  return 0;
}

Submission status: Runtime Error

Solution code:
x, a, b = map(int, input().split())

print((x - a) % b)

Submission status: Runtime Error

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: Runtime Error

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 * b + 50 * c == x:
                ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
A, B, C, X = map(int, [input() for i in  range(4)])
counter = 0
numA=min(X//500, A)
for a in range(0,numA+1):
    numB=min((X-500*a)//100,B)
    for b in range(0, numB+1):
        for c in range(0, C+1):
            if (X-500*a-100*b)-50*c==0:
                counter+=1
                print(a,b,c)
print(counter)

Submission status: Runtime Error

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

count = 0
a = 0
b = 0

for i in range(min(C, int(X/500)) + 1):
    a = X - 500 * i
    for j in range(min(B, int(a/100)) + 1):
        b = a - 100 * j
        if int(b/50) <= C:
            count += 1
        else:
            pass

print(count)

Submission status: Runtime Error

Solution code:
A,B,C,X=[int(input()) for i in range(4)]
cnt = 0
for a in range(0,A+1):
    Y = X - 500*a
    if Y==0:
        cnt += 1
        continue
    elif Y<0:
        break
    for b in range(0,B+1):
        Z = Y - 100*b
        if Z==0:
            cnt += 1
            break
        if Z<0:
            break
        if W%50 == 0:
            cnt += 1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x,a,b=map(int, input().split())

print((x-a)%b)

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,[input() for i in range(4)])
cnt=0
for aa in range(a+1):
    for bb in range(b+1):
        for cc in range(c+1):
            if aa*500+bb*100+cc*50 == x:cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
num50 = int(input())
num100 = int(input())
num500 = int(input())
amount = int(input())
rst = 0
for itr50 in range(num50+1):
    for itr100 in range(num100+1):
        for itr500 in range(num500+1):
            kingaku = itr50*50+itr100*100+itr500*500
            if(kingaku==amount):
                rst += 1
print(rst)

Submission status: Runtime Error

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 i*500+n*100+m*50==X:
                count += 1
print(count)

Submission status: Runtime Error

Solution code:

fh = int(input())
oh = int(input())
ft = int(input())
om = int(input())
count = 0

for i in range(fh + 1):
    if om < i * 500:
        break
    for j in range(oh + 1):
        if om < i * 500 + j * 100:
            break
        for k in range(ft + 1):
            nm = 0
            nm = i * 500 + j * 100 + k * 50
            if om == nm:
                count +=1

print(count)

Submission status: Runtime Error

Solution code:
print((int(input()-int(input()))%int(input()))

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
point=0
suma=0
for num in range(N+1):
  great_num=num
  S=0
  while(True):
    if num==0:
      break
    else:
      S=S+num%10
      num=num//10
  if A<=S and S <= B:
    suma=suma+great_num
print(suma)

Submission status: Runtime Error

Solution code:
a, b, c, x = [int(input()) for p in range(4)]
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: Runtime Error

Solution code:
x, a, b = [int(input() for i in range(3))]
print((x-a) % b)

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
a=a-b
while a>=0:
  a=a-c
  if a<0:
      a=a+c
      print(a)
      break

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
a=a-b
while a>=0:
  a=a-c
  if a<0:
      a=a+c
      print(a)
      break

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
a-b=a
while a>=0:
  a=a-c:
    if a<0:
      a=a+c
      print(a)
      break

Submission status: Runtime Error

Solution code:
x = int(input().split())
a = int(input().split())
b = int(input().split())
print((x-a)//b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,a,b = map(int, input().split())
print((x-a)%b)

Submission status: Runtime Error

Solution code:
x,a,b = map(int,input().split())
print((x-(x-a)/b))

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

print(count)

Submission status: Runtime Error

Solution code:
x = int(input())
b = int(input())
c = int(input())
x -= a
x = x- b*(x//b)
print(x)

Submission status: Runtime Error

Solution code:
x = int(input())
b = int(input())
c = int(input())
x -= a
x -= b*x//b
print(x)

Submission status: Runtime Error

Solution code:

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

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

print(num)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,C,X = [int(s) for s in open(0)]
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: Runtime Error

Solution code:
A, B, C, X = [int(s) for s in open(0)]
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: Runtime Error

Solution code:
X,A,B = map(int,input().split())
print((X-A)%B)

Submission status: Runtime Error

Solution code:
x,a,b=int((input() for _ in range(3)))
print((x - a)%b)

Submission status: Runtime Error

Solution code:
x,a,b=(int,input() for _ in range(3))
print((x - a)%b)

Submission status: Runtime Error

Solution code:
x,a,b=(input() for _ in range(3))
print((x - a)%b)

Submission status: Runtime Error

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

counter = 0

for i in range(0, a + 1):
	if x - (500 * i) >= 0:
		x_f = x - (500 * i)

		if x_f == 0:
			counter += 1
			break

		for j in range(0, b + 1):
			if x_f - (100 * j) >= 0:
				x_s = x_f - (100 * j)

				if x_s == 0:
					counter += 1
					break

				for k in range(0, c + 1):
					if x_s - (50 * k) >= 0:
						x_t = x_s - (50 * k)

						if x_t == 0:
							counter += 1
							break


print(counter)

Submission status: Runtime Error

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

counter = 0

for i in range(0, a + 1):
	if x - (500 * i) >= 0:
		x_f = x - (500 * i)

		if x_f == 0:
			counter += 1
			break

	for j in range(0, b + 1):
		if x_f - (100 * j) >= 0:
			x_s = x_f - (100 * j)

			if x_s == 0:
				counter += 1
				break

		for k in range(0, c + 1):
			if x_s - (50 * k) >= 0:
				x_t = x_s - (50 * k)

				if x_t == 0:
					counter += 1
					break


print(counter)

Submission status: Runtime Error

Solution code:
def aa087():
    x = int(input())
    a = int(input())
    b = int(input())

    c = x - a
    d = math.floor(c/b)
    c -= b*d
    print(c)

aa087()

Submission status: Runtime Error

Solution code:
x, a, b = map(int, input().split())
 print(x-(a+b))

Submission status: Runtime Error

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

c = x-a
print(int(c%b())

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
num=0
for i in range(a+1):
	x_i=x-500*i
	if x_i<0:
		break
	for j in range(b+1):
		#print('j:',j)
		x_j=x_i-100*j
		if x_j<0:
			break
		if x_j/50<=c:
			num+=1
			#print(x_j)
print(num)

Submission status: Runtime Error

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

sum = 0
cnt = 0

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

print(cnt)

Submission status: Runtime Error

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: Runtime Error

Solution code:
x,y,z=*[int(input()) for i in range(3)]
x-=(x//y)*y
x-=(x//z)*z
print(x)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
n = int(input())
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
a1 = list(accumulate(A1))
ans = 0
for i in range(n):
  sums = a1[i]
  A3 = A2[i:]
  a2 = list(accumulate(A3))
  sums += max(a2)
  ans = max(ans,sums)
print(ans)

Submission status: Runtime Error

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

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

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,a,b = [int(input) for i in range(3)]
print((x-a)%b)

Submission status: Runtime Error

Solution code:
(x, a, b) = (int(tok) for tok in input().split())
print((x - a) % b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,C,X = [int(x) for x in input().split()]
ans = 0
for i in range(A+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:
         ans+=1
print(ans)

Submission status: Runtime Error

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: Runtime Error

Solution code:
a,b,c=[int(input()) for i in range(3)]
    print((a-b) % c)

Submission status: Runtime Error

Solution code:
a,b,c=[int(input())for i in range(3)]
    print((a-b)%c)

Submission status: Runtime Error

Solution code:
a,b,c=[int(input())for i in range(3)]
a-=b
a%=c
    print(a)

Submission status: Runtime Error

Solution code:
x = int(input().split())
a = int(input().split())
b = int(input().split())

print((x - a)%b)

Submission status: Runtime Error

Solution code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())

counter = 0

for count_500 in range(coin_500 + 1):
    if count_500 * 500 > total:
        break
    for count_100 in range(coin_100 + 1):
        if count_500 * 500 + count_100 * 100 > total:
            break
        for count_50 in range(coin_50 + 1):
            if count_500 * 500 + count_100 * 100 + count_50 * 50 > total:
                break
            if count_500 * 500 + count_100 * 100 + count_50 * 50 == total:
                counter += 1

print(counter)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c, x = map(int, input().split())
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: Runtime Error

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: Runtime Error

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: Runtime Error

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

while x>=0 and a>=0:
  while x>=0 and b>=0:
    if x//50<=c:
      n+=1
    b-=1
    bcount+=1
    x-=100
  x+=100*bcount
  b+=bcount
  bcount=0
  a-=1
  x-=500  
print(n)

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
print((a-b) % c)

Submission status: Runtime Error

Solution code:
x = int().input()
a = int().input()
b = int().input()
print((x - a) % b)

Submission status: Runtime Error

Solution code:
a,b,c=int(input(),split())
d=a-b
print(d-(c*(d//c)))

Submission status: Runtime Error

Solution code:
n,k,x,y=(int(input()) for i in [0]*4)
print(n*x-(x-y)*max(n-k,0))

Submission status: Runtime Error

Solution code:
#ABC 087 B - Coins
import math
s = 0 #払い方の総数
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
x = int(input()) #払うべき総額

while x >= 0 and a>=0 :
    s += max(0, min(b, math.floor(x/100))-max(0,math.ceil((x-50*c)/100))+1)
    print(s)
    a -= 1
    x -= 500
print(s)

Submission status: Runtime Error

Solution code:
#ABC 087 B - Coins
import math
s = 0 #払い方の総数
a = int(input()) #500円玉の枚数
b = int(input()) #100円玉の枚数
c = int(input()) #50円玉の枚数
x = int(input()) #払うべき総額

while x >= 0 and a>=0 :
    s += max(0, min(b, math.floor(x//100))-math.ceil((x-50*c)//100)+1)
    print(a,x,s)
    a -= 1
    x -= 500
print(s)

Submission status: Runtime Error

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

print(x-a-(b*(x-a)//b)

Submission status: Runtime Error

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: Runtime Error

Solution code:
x,a,b = [int(input()) for i in range(3)]
print((x-a)%bå)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

asum=0
bsum=0
csum=0
cnt=0

for aa in range(0, a+1):
  if asum > x:
    break
  elif asum == x:
    cnt += 1
    break
    #print('asum:{} bsum:{} csum:{}'.format(asum , bsum,csum))
  
  bsum=0
  for bb in range(0, b+1):
    if asum + bsum > x:
      break
    elif asum + bsum == x:
      cnt += 1
      break
      #print('asum:{} bsum:{} csum:{} asum+bsum:{}'.format(asum , bsum,csum,asum + bsum))
      
    csum=0
    for cc in range(0, c+1):
      if asum + bsum + csum > x:
        break
      elif asum + bsum + csum == x:
        cnt += 1
        #print('asum:{} bsum:{} csum:{} asum+bsum+csum:{}'.format(asum , bsum,csum,asum + bsum+csum))
        
      csum += ctani
    
    bsum += btani
  
  asum += atani

print(cnt)

Submission status: Runtime Error

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

for aa in range(0, a+1):
  if asum > x:
    break
  elif asum == x:
    cnt += 1
    break
    #print('asum:{} bsum:{} csum:{}'.format(asum , bsum,csum))
  
  bsum=0
  for bb in range(0, b+1):
    if asum + bsum > x:
      break
    elif asum + bsum == x:
      cnt += 1
      break
      #print('asum:{} bsum:{} csum:{} asum+bsum:{}'.format(asum , bsum,csum,asum + bsum))
      
    csum=0
    for cc in range(0, c+1):
      if asum + bsum + csum > x:
        break
      elif asum + bsum + csum == x:
        cnt += 1
        #print('asum:{} bsum:{} csum:{} asum+bsum+csum:{}'.format(asum , bsum,csum,asum + bsum+csum))
        
      csum += ctani
    
    bsum += btani
  
  asum += atani

print(cnt)

Submission status: Runtime Error

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

asum=0
bsum=0
csum=0
cnt=0

for aa in range(0, a+1):
  if asum > x:
    break
  elif asum == x:
    cnt += 1
    break
  
  bsum=0
  for bb in range(0, b+1):
    if asum + bsum > x:
      break
    elif asum + bsum == x:
      cnt += 1
      break
      
    csum=0
    for cc in range(0, c+1):
      if asum + bsum + csum > x:
        break
      elif asum + bsum + csum == x:
        cnt += 1
        
      csum += ctani
    
    bsum += btani
  
  asum += atani

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
X,A,B = map(int,input().split(' '))
print((X - A) - int((X-A) /100) * B)

Submission status: Runtime Error

Solution code:
X,A,B = map(int,input().split(' '))
print(X - (A + B))

Submission status: Runtime Error

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

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
                        else:
                            cnt += 0
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

        
print(counter)

Submission status: Runtime Error

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

comb = 0

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

Submission status: Runtime Error

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: Runtime Error

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

count=0

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

print(str(count))

Submission status: Runtime Error

Solution code:
a,b,c,x = map(int,input().strip())


count=0

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

print(str(count))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import product

A = range(int(input()) + 1)
B = range(int(input()) + 1)
C = range(int(input()) + 1)
X = int(input())

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

Submission status: Runtime Error

Solution code:
a = []
for tmp in input():
    a.append(tmp)
cou = 0
for yen50 in range(a[2]+1):
    for yen100 in range(a[1]+1):

        for yen500 in range(a[0]+1):
            if (yen50*50 + yen100*100 + yen500*500) / a[3] == 1:
                cou += 1


print(cou)

Submission status: Runtime Error

Solution code:
from sys inmport stdin
X,A,B = map(int, stdin.read().splitlines())
print( (X-A)%B )

Submission status: Runtime Error

Solution code:
x,a,b=map(int,input().split())
x=x-a
x=x%b
print(x)

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
print((x-a)%b)

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
print((X - A) % B)

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
print((X-A)%B)

Submission status: Runtime Error

Solution code:
X = input()
A = input()
B = input()
Y = int((X - A)/B)
print(X - A - (B*Y))

Submission status: Runtime Error

Solution code:
x=input()
a=input()
b=input()
print((x-a)%b)

Submission status: Runtime Error

Solution code:
N = int(input())
row1 = map(int,input().split())
row2 = map(int,input().split())
 
sum1 = row1[0]
sum2 = sum(row2)
max_candy = sum1 + sum2
for i in range(1,N):
    sum1 += row1[i]
    sum2 -= row2[i-1]
    current = sum1+sum2
    if(max_candy < current):
        max_candy = current
print(max_candy)

Submission status: Runtime Error

Solution code:
N = int(input())
row1 = [map(int,input())]
row2 = [map(int,input())]
 
sum1 = row1[0]
sum2 = sum(row2)
max_candy = sum1 + sum2
for i in range(1,N):
    sum1 += row1[i]
    sum2 -= row2[i-1]
    current = sum1+sum2
    if(max_candy < current):
        max_candy = current
print(max_candy)

Submission status: Runtime Error

Solution code:
N = int(input())
row1 = map(int,input())
row2 = map(int,input())
 
sum1 = row1[0]
sum2 = sum(row2)
max_candy = sum1 + sum2
for i in range(1,N):
    sum1 += row1[i]
    sum2 -= row2[i-1]
    current = sum1+sum2
    if(max_candy < current):
        max_candy = current
print(max_candy)

Submission status: Runtime Error

Solution code:
X=input();A=input();B=input()
print(X-A-(X-A)//B)

Submission status: Runtime Error

Solution code:
a = int(input()) #500円
b = int(input()) #100円
c = int(input()) #50円
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: Runtime Error

Solution code:
x = int(input())
a = int(input())
b = int(input())
s= x-a
print(int(s-s*(b*(s//b)))

Submission status: Runtime Error

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)