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: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


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

    return (x-a) % b



print(main())

Submission status: Accepted

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

C = X - A

D = C % B

print(D)

Submission status: Accepted

Solution code:
"""
あなたは、X 円を持ってケーキとドーナツを買いに出かけました。
あなたはまずケーキ屋で 1 個 A 円のケーキを 1 個買いました。 次に、ドーナツ屋で 1 個 B 円のドーナツをできるだけたくさん買いました。
これらの買い物のあと手元に残っている金額は何円ですか。
"""

def buying_sweets(money,p_cake,p_dounuts):
    t_money  = money - p_cake
    c_dounuts = t_money // p_dounuts
    p_after_money = t_money - (c_dounuts * p_dounuts)
    return p_after_money

money = int(input())
p_cake = int(input())
p_dounuts = int(input())
print(buying_sweets(money,p_cake,p_dounuts))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
Y = X - A
while Y >= B:
    Y = Y - B
print(Y)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
Y = X - A
while Y >= B:
    Y = Y-B
print (Y)

Submission status: Accepted

Solution code:
x = int(input())

a = int(input())


money = x-a

b = int(input())
while money > 0:
    if((money - b ) >= 0):
        money -= b
    else:
        break
print(money)

Submission status: Accepted

Solution code:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！

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

X = X - A
for i in range(1,1000):
    if X < B:
        break
    else:
        X = X - B
print(X)

Submission status: Accepted

Solution code:
x = int(input())
a = int(input())
b = int(input())
sub = x - a
while sub >= b:
    sub -= b
print(sub)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calc(X, A, B):
    X -= A

    return X - X // B * B


if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())

    print(calc(X, A, B))

Submission status: Accepted

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

y = (X - A) % B

print(y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(input()) for i in range(3)]
print((A[0]-A[1])%A[2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = [int(input()) for i  in range (3)]
print ((list[0]-list[1]) % list[2])

Submission status: Accepted

Solution code:
l = [int(input()) for i in range(3)]
print ((l[0]-l[1]) % l[2])

Submission status: Accepted

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

c = x - a

print(c % b)

Submission status: Accepted

Solution code:

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

X -= A
print(X % B)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
print (X - A) % B

Submission status: Accepted

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

t = X - A
ans = t%B

print(ans)

Submission status: Accepted

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

n = (x - a)//b

print(x - a - b * n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
X = int(input())
# スペース区切りの整数の入力
#a, b = map(int, input().split())
# 文字列の入力
#s = input()
a = int(input())
b = int(input())
ans= (X-a)%b

# 出力
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

print((x - a) %b)

Submission status: Accepted

Solution code:
# 1.入力
X = int(input())
A = int(input())
B = int(input())

# 2.制約チェック
if A<1 or A>1000:
    print("制約条件1<=A<=1000")
    raise ValueError
elif B<1 or B>1000:
    print("制約条件1<=B<=1000")
    raise ValueError
elif X<A+B or X>10000:
    print("制約条件A+B<=X<=10000")
    raise ValueError

# 3.Aを引く
residue = X-A

# 4.Bを引く
while(1):
    if residue-B >= 0:
        residue = residue-B
    else:
        break
    
    
# 5.結果の表示
print(residue)

Submission status: Accepted

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

ans = (x - a) % b
print(ans)

Submission status: Accepted

Solution code:
total = int(input())
cake = int(input())
donut = int(input())
money = total - cake
while money >= donut:
    money = money - donut
print(money)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    x = int(input())
    a = int(input())
    b = int(input())
    if x <= a:
        print(0)
    else:
        print((x - a) % b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())
X -= A
while X >= B:
    X -= B
print X

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc087a

x=int(raw_input())
a=int(raw_input())
b=int(raw_input())

print (x-a)%b

Submission status: Accepted

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

import sys

x = int(raw_input().split()[0])
a = int(raw_input().split()[0])
b = int(raw_input().split()[0])

sys.stdout.write('%d\n' % ((x - a) % b))
sys.stdout.flush()

Submission status: Accepted

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

reX = X - A;
print(reX%B)

Submission status: Accepted

Solution code:
#-*- coding:utf-8 -*-
x = int(input())
a = int(input())
b = int(input())

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

Submission status: Accepted

Solution code:
info = [int(input()) for i in range(3)]
print((info[0]-info[1])%info[2])

Submission status: Accepted

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

Submission status: Accepted

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

y = (x-a)%b
print(y)

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
y=x-a
z=y % b
print(str(z))

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
X -= A
while True :
    X -= B
    if X >= 0 :
        continue
    else :
        break
print(X + B)

Submission status: Accepted

Solution code:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

X = X - A
while X >= 0:
    X = X - B

print(X + B)

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)


def solve(X, A, B):
    X -= A
    n = X // B
    return X - n * B


def main():
    X = int(input())
    A = int(input())
    B = int(input())
    print(solve(X, A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

x -= a
x %= b

print(x)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
N = (X-A) % B
print(N)

Submission status: Accepted

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

Submission status: Accepted

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

m = int((X-A)/B)
print (X-A-m*B)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
x = int(input())
a = int(input())
b = int(input())
print((x-a)-(b*((x-a)//b)))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



def main():
    X = int(input())
    A = int(input())
    B = int(input())

    ans = (X-A) % B
    print(ans)

if __name__ == "__main__": main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc087/tasks/abc087_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(X, A, B):
    nokori = X - A
    return nokori % B


def main(args):
    X = int(input())
    A = int(input())
    B = int(input())
    ans = solve(X, A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
y = int(input())
z = int(input())
print( (x - y) % z)

Submission status: Accepted

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

ans = (x-a)%b
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,A,B = tuple(int(input()) for i in range(3))
print((X-A)%B)

Submission status: Accepted

Solution code:
#-*- coding: utf-8 -*-
a = int(input())
b = int(input())
c = int(input())
print((a-b)%c)

Submission status: Accepted

Solution code:
money = int(input())
cake = int(input())
donut = int(input())

money = money - cake
surplus = money % donut
money = money - donut * surplus
print(surplus)

Submission status: Accepted

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

x_minus_a = x - a
ans = x_minus_a % b
print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
a = int(stdin.readline())
b = int(stdin.readline())
c = int(stdin.readline())
print (a-b)%c

Submission status: Accepted

Solution code:
X=int(raw_input())
A=int(raw_input())
B=int(raw_input())
print((X-A)%B)

Submission status: Accepted

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

x = int(raw_input())
a = int(raw_input())
b = int(raw_input())

print str((x-a)%b)

Submission status: Accepted

Solution code:
import sys
x, a, b = map(int, sys.stdin.read().split("\n")[:3])
print((x-a) % b)

Submission status: Accepted

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

c=x-a
print(c%b)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

data = X - A
data = data % B
print(data)

Submission status: Accepted

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

x -= a
_, ans = divmod(x, b)
print(ans)

Submission status: Accepted

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

# ケーキを一つ購入
X -= A

while X >= B:
    X -= B

print(X)

Submission status: Accepted

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

print(X - A - (X - A)//B*B)

Submission status: Accepted

Solution code:
total = int(input())
cake = int(input())
dounut = int(input())

answer = (total - cake) % dounut
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
A = int(input())
B = int(input())
p = N - A
ans = p - (p // B) * B
print(ans)

Submission status: Accepted

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

zankin = x - a
amari = zankin % b

print(amari)

Submission status: Accepted

Solution code:
input_lines = input()
int_x = int(input_lines)
input_lines2 = input()
int_a = int(input_lines2)
input_lines3 = input()
int_b = int(input_lines3)
int_x = int_x - int_a
while True:
	if int_x >= int_b:
		int_x = int_x - int_b
	else:
		break

print(int_x)

Submission status: Accepted

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

print(X-A-B*int((X-A)/B))

Submission status: Accepted

Solution code:
x = int(raw_input())
a = int(raw_input())
b = int(raw_input())
left = x - a
print left % b

Submission status: Accepted

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

def main(): 
    argent = int(input())
    gateau = int(input())
    donut = int(input())
    print((argent-gateau)%donut)

main()

Submission status: Accepted

Solution code:
x = input()
x_1 = int(x)
a = input()
a = int(a)
b = input()
b = int(b)
x_2 = x_1 - a
anw = x_2 % b
print(anw)

Submission status: Accepted

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

M = X-A

while True:
    if (M - B) >= 0:
        M = M - B
    else:
        break

print M

Submission status: Accepted

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

print(x%b)

Submission status: Accepted

Solution code:


from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log
from itertools import *
import string
import copy
import random
import bisect
from decimal import *
def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).split())

x=input()
a=input()
b=input()
print (x-a)%b

Submission status: Accepted

Solution code:
import sys
a = []
for line in sys.stdin:
    a.append(int(line))
q = a[0] - a[1]
p = q % a[2]
print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
  X = int(input())
  A = int(input())
  B = int(input())
  remain = X - A
  remain = remain % B
  print(remain)

Submission status: Accepted

Solution code:
a=int(raw_input());b=int(raw_input());c=int(raw_input())
print (a-b)%c

Submission status: Accepted

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

x = (x-A)

y = x%B
print(y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
money = int(input())
a = int(input())
b = int(input())
money -= a
while money >= b:
	money -= b

print(money)

Submission status: Accepted

Solution code:
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())

pre_cash = X - A

while pre_cash >= B :
    pre_cash -= B

print pre_cash

Submission status: Accepted

Solution code:
# coding=utf-8

if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())

    print((X - A) % B)

Submission status: Accepted

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

remain = x - a
b_cnt = remain // b
remain = remain - b * b_cnt

print(remain)

Submission status: Accepted

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

x1 = x - a
while x1 >= 0:
    x1 -= b
print(x1 + b)

Submission status: Accepted

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

tmp = x - a
ans = tmp % b

print(ans)

Submission status: Accepted

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

x = x-A
n = x//B
print(x-n*B)

Submission status: Accepted

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

X -= A
X -= X // B * B

print(X)

Submission status: Accepted

Solution code:
have = int(input())
cake = int(input())
donutu = int(input())

have = have - cake

count = have // donutu
donutus = count * donutu
have = have - donutus

print(have)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    
    x = int(raw_input())
    a = int(raw_input())
    b = int(raw_input())
    
    print (x-a)%b

Submission status: Accepted

Solution code:
aa = int(input())
cake = int(input())
donut = int(input())

nokori = aa - cake
print(nokori%donut)

Submission status: Accepted

Solution code:

def solve():
    n = int(input())
    a = int(input())
    b = int(input())
    n -= a

    print(n % b)

solve()

Submission status: Accepted

Solution code:
import numpy as np

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

ans = x - a
ans = ans % b

print(ans)

Submission status: Accepted

Solution code:
def main():
    X, A, B = [int(input()) for _ in [0] * 3]

    ans = (X - A) % B
    print(ans)

main()

Submission status: Accepted

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

x -= a

while x >= b:
    x -= b

print(x)

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    A = int(input())
    B = int(input())
    X = X - A
    return print(X % B)

main()

Submission status: Accepted

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

S = X-A

ans = S % B
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! cat input | python3 main.py
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Submission status: Accepted

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

now = X
now = now - A
while now -B >= 0:
   now = now - B

print(now)

Submission status: Accepted

Solution code:
X=int(input())
A=int(input())
B=int(input())
Y=X-A
while Y>=0:
    Y=Y-B
print(Y+B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Submission status: Accepted

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

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

Submission status: Accepted

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

coin = X - A

print(coin % B)

Submission status: Accepted

Solution code:
# coding: UTF-8
def solve():
  X = int(input())
  A = int(input())
  B = int(input())
  
  return str((X-A) % B)
 
if __name__ == '__main__':
  ans = solve()
  print(ans, flush=True)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8

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

X = X - A
print(X%B)

Submission status: Accepted

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


print( (x-a)%b )

Submission status: Accepted

Solution code:
print( ( int(input()) - int(input()) ) % int(input()), end='')

Submission status: Accepted

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

d = (x - a) // b
res = x - a - d * b
print(res)

Submission status: Accepted

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

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

y = x - a
z = y // b

print(y - b*z)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
y = int(input())
z = int(input())

res = (x-y) % z

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(raw_input(''))
a=int(raw_input(''))
b=int(raw_input(''))
print (x-a)%b

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
count = (X - A) // B

print(X - A - B * count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
a = X-A
print(a % B)

Submission status: Accepted

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

donus = (X - A) // B
res = X - A - B * donus
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

x=x-a
x=x % b

print x

Submission status: Accepted

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

Submission status: Accepted

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

print(int((N-A)%B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    x -= a
    x = x - x // b * b
    print(x)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

x = x - a
x = x % b

print(x)

Submission status: Accepted

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

okane=x-a

while okane>=0:
    okane=okane-b

print(okane+b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x = input()
a = input()
b = input()

print (x - a) % b

Submission status: Accepted

Solution code:
def ketanowa(p):
    ans=0
    p=str(p)
    for i in p:
        ans+=int(i)
    return ans

def main():
    temp=input()
    n=int(temp)
    temp=input()
    a=int(temp)
    temp=input()
    b=int(temp)
    n=n-a
    k=int(n/b)
    n=n-b*k
    print(n)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# coding: utf-8

import numpy as np

def slove(s, b):
    return s%b


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

    print(slove(x-a, b))

Submission status: Accepted

Solution code:
# -- coding: utf-8 --
x = int(input())
a = int(input())
b = int(input())
x -= a
x -= (x // b) * b
print(x)

Submission status: Accepted

Solution code:
argent = int(input())
gateau = int(input())
donut = int(input())

argent -= gateau
argent %= donut
print(argent)

Submission status: Accepted

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

X -= A
ans = X % B

print ans

Submission status: Accepted

Solution code:
import collections
from pprint import pprint as pp

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

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    A = int(input())
    B = int(input())

    ans = (X - A) % B
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
A = int(input()) 
B = int(input())
print((X-A)%B)

Submission status: Accepted

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

print((n-a) % b)

Submission status: Accepted

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

print((N - A) % B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding=utf-8

import sys

x = int(sys.stdin.readline().strip())
a = int(sys.stdin.readline().strip())
b = int(sys.stdin.readline().strip())

print((x - a) % b)

Submission status: Accepted

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

Submission status: Accepted

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

x = x-a
x = x%b
print x

Submission status: Accepted

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


print((X - A) % B)

Submission status: Accepted

Solution code:
def solve():
    X = int(input())
    A = int(input())
    B = int(input())
    print((X-A)%B)
    return

solve()

Submission status: Accepted

Solution code:
money = int(input())

money -= int(input())

money %= int(input())

print(money)

Submission status: Accepted

Solution code:
X = int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a = int(input())
b = int(input())
x = x-a
while x >= b:
	x = x-b
print(x)

Submission status: Accepted

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

Submission status: Accepted

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

x -= a
x %= b

print(x)

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.buffer.readline
in_n = lambda: int(input())
in_nn = lambda: map(int, input().split())
in_s = lambda: input().rstrip().decode('utf-8')
in_map = lambda: [s == ord('.') for s in input() if s != ord('\n')]

MOD = 10**9 + 7
INF = 8 * 10**18


def main():

    X, A, B = in_nn()
    print((X - A) % B)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力

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

i = 0
j = 0
k = 0
cnt = 0
sum = 0
while i <= A:
    j = 0
    while j <= B:
        k = 0
        while k <= C:
            if i+j+k >50:
                break
            else:
                sum = 500*i + 100*j + 50*k
                if X == sum:
                    cnt += 1
            k += 1
            sum = 0
        j += 1
    i += 1

print(cnt)

Submission status: Runtime Error

Solution code:

X=input()
A=input()
B=input()
X -= A
Y = X % B
print(Y)

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+a)%b)

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

xa = x - a
xab = xa // b
answer = xa - (b * xab)

print(answer)

Submission status: Runtime Error

Solution code:

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

answer = (x-a) % b

print(answer)

Submission status: Runtime Error

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

# 処理
answer = (x-a) % b

# 出力
print(answer)

Submission status: Runtime Error

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

# 処理
left = x - a
b_quantity = left // b
b_price = b * b_quantity
answer = left - b_price

# 出力
print(answer)

Submission status: Runtime Error

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

# 処理
left = x - a
b_quantity = left // b
answer = left - b * b_quantity

# 出力
print(answer)

Submission status: Runtime Error

Solution code:
N = int(input())
candies_i = list(map(int, input().split()))
candies_j = list(map(int, input().split()))

l = []

for i in range(N):
    total_li = sum(candies_i[:+=1])
    total_lj = sum(candies_j[+=1:])
    total = total_li + total_lj
    l.append(total)

print(max(l))

Submission status: Runtime Error

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

cnt = 0
a_min = min( int(x/500) ,a)
for ai in range(a_min+1):
    rem_a = x - (ai * 500)
    if rem_a == 0:
        cnt+=1
        break
    b_min = min( int(rem_a/100) ,b)
    for bi in range(b_min+1):
        rem_b = rem_a - (bi * 100)
        if rem_b == 0:
            cnt+=1
            break
        c_min = min( int(rem_b/50) ,c)
        for ci in range(c_min+1):
            rem_c = rem_b - (ci * 50)
            if rem_c == 0:
                cnt+=1
                break

print(cnt)

Submission status: Runtime Error

Solution code:
import sys
import math
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counter = 0
a_min = min( math.floor(x/500) ,a)
for ai in range(a_min+1):
    rem_a = x - (ai * 500)
    if rem_a == 0:
        counter+=1
        break
    b_min = min( math.floor(rem_a/100) ,b)
    for bi in range(b_min+1):
        rem_b = rem_a - (bi * 100)
        if rem_b == 0:
            counter+=1
            break
        c_min = min( math.floor(rem_b/50) ,c)
        for ci in range(c_min+1):
            rem_c = rem_b - (ci * 50)
            if rem_c == 0:
                counter+=1
                break
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:

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) - (b * ((x - a) // b)))


if __name__ == "__main__":
    main()
i

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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