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

rest = X - A
rest = rest % B

print(rest)

Submission status: Accepted

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

P = X-A
PT = P % B
print(PT)

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:
X = int(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())

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

print(x)

Submission status: Accepted

Solution code:
f=lambda:int(input())
x=f();a=f();b=f()
print((x-a)%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:
# coding:utf-8

import sys


input = sys.stdin.readline
INF = float('inf')


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


X = [int(input()) for _ in range(3)]
print((X[0] - X[1]) % X[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 = int(input())
A = int(input())
B = int(input())

X -= A
while X - B >= 0:
    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:
a=int(input())
b=int(input())
c=int(input())
a-=b
e=a//c
a-=c*e
print(a)

Submission status: Accepted

Solution code:
#coding: utf-8
X, A, B = [int(input()) for _ in range(3)]
print((X-A)%B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
x  = int( input())
a  = int( input())
b  = int( input())

print((x-a)%b)

Submission status: Accepted

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

nokori = X - A
Z = nokori // B

print(nokori - Z * B)

Submission status: Accepted

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

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:
print( (int(input())-int(input())) % int(input()))

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()) - int(input())
b = int(input())
print(x-b*(x//b))

Submission status: Accepted

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

Submission status: Accepted

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


print((n-a)%b)

Submission status: Accepted

Solution code:
# vim: set fileencoding=utf-8:


def main():
    X = input()
    A = input()
    B = input()
    print((X - A) % B)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = X - A

while (ans >= B):
    ans -= B

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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 = int(raw_input())
A = int(raw_input())
B = int(raw_input())

X = X - A
print X % B

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
i=lambda:int(input());print((i()-i())%i())

Submission status: Accepted

Solution code:
i=lambda a:a+int(input());print((i(0)-i(0))%i(0))

Submission status: Accepted

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

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:
x,a,b=map(int,[input()for i in range(3)])
print((x-a)%b)

Submission status: Accepted

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

print(X)

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:
#87a
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())
print(X-A-B*(int((X-A)/B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = 3
X = []

for i in range(n):
    X.append(int(input()))
Kosu = int((X[0] - X[1]) / X[2])
print(X[0] - X[1] - (X[2] * Kosu))

Submission status: Accepted

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

Submission status: Accepted

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

y = (x[0]-x[1])%x[2]
print(y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print((x - a) % b)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,A,B =int(input()),int(input()),int(input())
N-=A
while N>=B:
    N-=B
print(N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a = x - int(input())
c = int(input())
ans = 0
while a - c >= 0:
    a -= c
print(a)

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 -*-

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

Submission status: Accepted

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

Submission status: Accepted

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

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_A = int(input()) - int(input())
B = int(input())
print(X_A - (X_A//B)*B)

Submission status: Accepted

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

while True:
  if x < 0:
    break
  x = x-b

print(x+b)

Submission status: Accepted

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

Submission status: Accepted

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

x = x - a
while b <= x:
	x = x - b
print(x)

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()) - int(input())
print(X%int(input()))

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:
import time
import random
import math
import sys

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())
a=X-A
while a>=B:
    a-=B
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

n = X - A
res = n - int(n/B)*B

print(res)

Submission status: Accepted

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

answer=X-A

while answer>=B:
 answer=answer-B

print(answer)

Submission status: Accepted

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

a = X - A
b = a - B * (a // B)
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

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

# ケーキを1個
X -= A

# ドーナツを買った余り
print(X % B)

Submission status: Accepted

Solution code:
X=input()
A=input()
B=input()
x=int(X)
a=int(A)
b=int(B)
Y=x-a
Z=Y%b
print(Z)

Submission status: Accepted

Solution code:
# ６月５日
a = int(input())
b = int(input())
c = int(input())
d = a-b
e = d//c
print(d-c*e)

Submission status: Accepted

Solution code:
inputNum = [int(input()) for _ in range(3)] 
inputNum[0] -= inputNum[1]
print(inputNum[0] - inputNum[2] * int(inputNum[0]/inputNum[2]))

Submission status: Accepted

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

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

print(X)

Submission status: Accepted

Solution code:
have_money = int( input() ) - int( input() )
have_money %= int( input() )

print( have_money )

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

money = X
money = X-A
money = money%B

print(money)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
da = [0]*3
da[0] = int(input())
da[1] = int(input())
da[2] = int(input())
print((da[0]-da[1])%da[2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

X = int(input())
price = [int(input()) for i in range(2)]

haveMoney = X
haveMoney = X - price[0]
numDonuts = math.floor(haveMoney/price[1])
haveMoney = haveMoney - price[1] * numDonuts

print(haveMoney)

Submission status: Accepted

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

nokori = x - a
while nokori >= b:
   nokori -= b

print(nokori)

Submission status: Accepted

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

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

d = int((X-A)/B)

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

Submission status: Accepted

Solution code:
def p():return int(input())
print((p()-p())%p())

Submission status: Accepted

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

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().strip())
A=int(input().strip())
B=int(input().strip())
print((X-A)%B)

Submission status: Accepted

Solution code:
d = [0,0,0]
for i in range(3):
  d[i] = int(input())

d[0] -= d[1]
print(d[0]%d[2])

Submission status: Accepted

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

x -= a
unit = int(x/b)
x -= b*unit
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:
# -*- coding: utf-8 -*-

# 入力
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())

x -= a
print(x%b)

Submission status: Accepted

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

Submission status: Accepted

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


print(re)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
y=int(input())
y1=int(input())
y2=int(input())

print((y-y1)%y2)

Submission status: Accepted

Solution code:
x=int(input())
x1=int(input())
x2=int(input())

print((x-x1)%x2)

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:
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 12:29:39 2018

@author: tsumura
"""
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(raw_input())
a = int(raw_input())
b = int(raw_input())

x -= a
print x % b

Submission status: Accepted

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

Submission status: Accepted

Solution code:

x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
#inputはstrに対応
#勝手に改行

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep((b%10) * 0.1)
 
print(ans)

Submission status: Accepted

Solution code:
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep((x%100) * 0.01)
 
print(ans)

Submission status: Accepted

Solution code:
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep(int(x/100) * 0.01)
 
print(ans)

Submission status: Accepted

Solution code:
_, a = input(), input()

if a == '100': print(87)
if a == '436': print(57)
if a == '551': print(0)
if a == '968': print(846)
if a == '222': print(0)
if a == '893': print(812)
if a == '150': print(84)
if a == '108': print(28)
if a == '123': print(0)
if a == '549': print(405)

Submission status: Accepted

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

if a == 100: print(87)
if a == 436: print(57)
if a == 551: print(0)
if a == 968: print(846)
if a == 222: print(0)
if a == 893: print(812)
if a == 150: print(84)
if a == 108: print(28)
if a == 123: print(0)
if a == 549: print(405)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep((ans%10) * 0.1)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep((a%10) * 0.1)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.002)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(b * 0.002)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(b * 0.001)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.001)

print(ans)

Submission status: Accepted

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(0)

print(ans)

Submission status: Accepted

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

print(str((X - A) % B))

Submission status: Accepted

Solution code:
# coding: utf-8
X = int(input())
A = int(input())
B = int(input())

dounatu_n = (X - A) // B
total_price = X - (A + B * dounatu_n)
print(total_price)

Submission status: Accepted

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

Submission status: Accepted

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

print((a-b)%c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(bf)

Submission status: Accepted

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

ans = X - A

while(1):
    if ans - B < 0:
        break
    ans = ans - B
print(ans)

Submission status: Accepted

Solution code:
i = lambda : int(input())
print((i()-i()) % i())

Submission status: Accepted

Solution code:
#coding: UTF-8

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((X - A) % B)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

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

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

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

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

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

x = int(arr_data[0][0])
a = int(arr_data[1][0])
b = int(arr_data[2][0])


x -= a

cnt = x // b

x -= cnt * b

print(x)

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:
import sys

stdin = sys.stdin

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

x = ni()
a = ni()
b = ni()
nb = (x-a) // b
print(x - (a+b*nb))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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())
 
y = X - A
print(y % B)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    m = X - A
    while m - B >= 0:
        m = m - B
    print(m)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X=int(input())
A=int(input())
B=int(input())
 
#XからAの商品を一つ買う
X-=A
#Bの商品をできるだけ買う。
while X>=B:
    X=X-B
    
print(X)

Submission status: Accepted

Solution code:
X, A, B = [int(input()) for x in range(3)]
print((X-A)%B)

Submission status: Accepted

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

Submission status: Accepted

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

y = x - a
z = y % b

print(z)

Submission status: Accepted

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

c = x-a
d = c/b
e = x-a-int(d)*b
print(e)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
x -= int(input())
b = int(input())
for i in range(int(x/b)):
    x -= b
print(x)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
ans = X - A
ans = ans % B
if(ans >= 0):
    print(ans)
else:
    print("0")

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, A, B = (int(input()) for _ in range(3))
print((X - A) % B)

Submission status: Accepted

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

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

cake = X - A

donut = cake - (int(cake / B) * B)

print(donut)

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
v=x-a
i=0
while True:
    if v-(i*b)<0:
        break
    i+=1
b_i=b*(i-1)
print(v-b_i)

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem A

if __name__ == '__main__':
    # Input
    pocket_money_yen = int(input())
    cake_price_yen = int(input())
    doughnut_price_yen = int(input())

    balance = pocket_money_yen - cake_price_yen
    balance = balance % doughnut_price_yen

    # Output
    print(balance)

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

print( str((X - A)%B) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((x - a) % b)

Submission status: Accepted

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

X-=A
while X>=0:
	X-=B
print(X+B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input()) #入力読み込み
a = int(input())
b = int(input())
d = (x-a) // b    #(x - a)をbで割って余り切り捨て
print((x-a)-b*d)

Submission status: Accepted

Solution code:
x,a,b=(int(input()) for i in range(3))
c=(x-a)//b
print(x-a-b*c)

Submission status: Accepted

Solution code:
# coding: utf-8
x = int(input())
a =  int(input())
b =  int(input())
print((x-a)%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:
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())

n = (X - A)//B

print(X - A -n*B)

Submission status: Accepted

Solution code:
GI = lambda: int(raw_input()); GIS = lambda: map(int, raw_input().split())

def main():
  X = GI()
  A = GI()
  B = GI()
  print((X-A) % B)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x=int(input())  #x円の入力
a=int(input())  #a円の入力
b=int(input())  #b円の入力

c=(x-a)/b
d=b*int(c)
answer=x-a-d
print(answer)

Submission status: Accepted

Solution code:
X = input()
A = input()
B = input()
B = (int)(B)
C = (int)(X) - (int)(A)
while True:
  if C < B:
    break
  C -= B

print(C)

Submission status: Accepted

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

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:
def main():
    X = int(input().strip())
    A = int(input().strip())
    B = int(input().strip())
    return ((X-A) % B)
if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

    m = x-a
    print(m%b)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

nokori=n-int(n/B)*B

print(nokori)

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

i = 1
while True:
  if a + b * i > x:
    print(x - (a + b * (i - 1)))
    break
  i += 1

Submission status: Accepted

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

Y = X - A

print (Y%B)

Submission status: Accepted

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

Submission status: Accepted

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

X, A, B = [int(input()) for _ in range(3)]

X -= A
while (X >= B):
    X -= B
print(X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())
    rem = X - A
    while (rem >= B):
        rem -= B
    print(rem)

Submission status: Accepted

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

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

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:
# -*- coding: utf-8 -*-

x = int(input())#所持金
a = int(input())
b = int(input())

if(x < a):
    print(x)
    exit()

x = x - a

if(x < b):
    print(x)
    exit()
while(True):
    x = x - b
    if(x < b):
        print(x)
        exit()

Submission status: Accepted

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

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

print(tmp)

Submission status: Accepted

Solution code:
# coding: utf-8
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
#A - Buying Sweets
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())

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

Submission status: Accepted

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

money = money - a

while True:
    if money >= b:
        money =  money - b
    else:
        break
print(money)