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:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    X = int(input())
    A = int(input())
    B = int(input())
    print((X-A)%B)
    
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:
x = int(input())
a = int(input())
b = int(input())

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

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

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

X = X - A
print(X%B)

Submission status: Accepted

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


def solve(X: int, A: int, B: int):
    ret = (X - A) % B
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(X, A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:



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

    print((a - b) % c)




if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

cost=x-a

answer=cost%b

print(answer)

Submission status: Accepted

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

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

print(ans)

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())
print(X-A - (X-A)//B*B)

Submission status: Accepted

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

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

print(int(ans))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
x=int(input())
a=int(input())
b=int(input())
d=x-a
c=math.floor(d/b)
print(d-b*c)

Submission status: Accepted

Solution code:
# sys.stdin.readline()
import sys
input = sys.stdin.readline

x = int(input())
a = int(input())
b = int(input())
x -= a
for i in range(1,10000):
    if x < b*i:
        print(x-b*(i-1))
        sys.exit()

Submission status: Accepted

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

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 -= A

X -= ((X // B)*B)

print(X)

Submission status: Accepted

Solution code:
x,a,b=[int(input()) for i in '000']

print((x-a)%b)

Submission status: Accepted

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

ans = x - a
while True:
    if ans - b < 0:
        break
    else:
        ans = ans - b

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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

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

c = X - A
d = c % B
e = c - (d*B)
print(d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    a = f()[0]
    b = f()[0]

    print((x-a)%b)

solve()

Submission status: Accepted

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

Submission status: Accepted

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

ans = inLst[0] - inLst[1]
ans = ans % inLst[2]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,a,b = map(int,open(0).read().split())
x -= a
if x < 0 or x <= b:
  print(0)
else:
  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:
a,b,c = [int(input())for i in range(3)]
print((a-b)%c)

Submission status: Accepted

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

tmp=X-A

while tmp >= B:
  tmp=tmp-B
print(tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

    return x, a, b


def submit():
    x, a, b = read_input()

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

    print(t)

if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
inf = [int(input()) for i in range(3)]
a = inf[0]-inf[1]
b = int(a/inf[2])
ans = a-b *inf[2]
print(ans)

Submission status: Accepted

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

m=x-a

print(int(m%b))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

m=x-a
print(m%b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# , = map(int, input.split())
#  = int(input())

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 -= a

print(x % b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = input()
c = input()
x = a - b
y = x / c
z = y * c
print x - 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 = int(input())
a = int(input())
b = int(input())
n = (x-a) // b
if (x-a) % b == 0:
    print('0')
else:
    print(x - a - n*b)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
ans = 0
remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    ans = remain
    break
  elif (remain - B) == 0:
    ans = 0
    break
  else:
    remain -= B
print(ans)

Submission status: Accepted

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

x, a, b = [int(input()) for _ in range(3)]

x -= a

x -= x//b*b

print(x)

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

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC087A - Buying Sweets
x, a, b = [int(input()) for _ in range(3)]
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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, a, b = eval("int(input())," * 3)
print((x - a) % b)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
X -= A
a, b = divmod(X, B)
print(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:
import math
X=int(input())
A=int(input())
B=int(input())
num=math.floor((X-A)/B)
print(X-A-B*num)

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


x -= a
print(x%b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = (int(input()) for _ in range(3))

print((a-b)%c)

Submission status: Accepted

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

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:
#087 A

X =int(input())
A =int(input())
B =int(input())
S=X-A
S=S-((S)//B * B)
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

X = X - A

print(X%B)

Submission status: Accepted

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

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:
X=int(input())
A=int(input())
B=int(input())
a=(X-A)//B
ans=X-A-B*a
print(ans)

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())
C = X - A   #Aを買った残り
D = C // B  #Bを買える数
print(C - B * D)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import sys


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

print((x-a)%b)

Submission status: Accepted

Solution code:
X,A,B=eval('int(input()),'*3);X-=A
print(X%B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = x- a
print(x % b)

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())
ans=x-a
while ans>=b:
  ans-=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())
X -= a
k = X//b
print(X - b*k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(string):
    x, a, b = map(int, string.split())
    return str((x - a) % b)


if __name__ == '__main__':
    n = 3
    print(solve('\n'.join([input() for _ in range(n)])))

Submission status: Accepted

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

X = X - A

if X < B:
  print(0)
else:
  print(X % B)

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((x-a) % b)

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())
nokori = X - A
donatu = nokori//B
nokori = nokori - donatu*B
print(nokori)

Submission status: Accepted

Solution code:
X=int(input())
A=int(input())
B=int(input())
print(str((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,a,b=[int(input()) for i in range(3)]
c=x-a
print(c%b)

Submission status: Accepted

Solution code:
#ABC87
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 %= 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:

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

print( (x-a)%b )

Submission status: Accepted

Solution code:
x,a,b=map(int,[input() for _ in range(3)])
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:
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()

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())
if x-a==0:
   print(0)
else:
   print((x-a)%b)

Submission status: Accepted

Solution code:
def buying_sweets(X: int, A: int, B: int) -> int:
    return (X - A) % B


if __name__ == "__main__":
    X = int(input())
    A = int(input())
    B = int(input())
    ans = buying_sweets(X, A, B)
    print(ans)

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())for _ in range(3)]
ans=x-a
while ans>=b:
    ans-=b
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
	X = int(input())
	A = int(input())
	B = int(input())
	
	X -= A
	ans = X % B
	
	print(ans)
		
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc087/tasks/abc087_a

import itertools
import collections
import bisect

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# A
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
print(x%B)

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  X = int(input())
  A = int(input())
  B = int(input())
  
  print((X-A)%B)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    X = int(input())
    A = int(input())
    B = int(input())

    print((X-A)%B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
i=input;print(eval(i()+'-'+i())%int(i()))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

data = [stdin.readline().rstrip() for _ in range(3)]
x, a, b = [int(l) for l in data]
print((x-a)%b)

Submission status: Accepted

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

ans = (X - A) % B

print(ans)
print()

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

print( ( X - A ) % B )

Submission status: Accepted

Solution code:
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X = I()
A = I()
B = I()

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
print(x%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())
x-=a
while x>=b:
    x-=b
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_x = int(input())
int_a = int(input())
int_b = int(input())

int_b_count = (int_x - int_a) // int_b

print(int_x - int_a - (int_b * int_b_count))

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

X -= A
X %= B

print(X)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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
ans = x-a
ans = ans%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:
# encoding:utf-8

import numpy as np
import random

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

cash = X
cash -= A

cash = cash - B*(cash // B)

print(cash)

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

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*(x//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())
z = X-A
ans = z%B
print(ans)

Submission status: Accepted

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

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:
X = int(input())
A = int(input())
B = int(input())
C=X-A
D=C//B
print(C-D*B)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
X = X - A
print(X-B*(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 = int(input())
a = int(input())
b = int(input())
tmp = x - a
print(tmp - (tmp // b) * b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print((X - A) % B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


abc087_a()

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

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

Submission status: Accepted

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

print((a - b)%c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


def main():
    """Function."""
    x = int(input())
    a = int(input())
    b = int(input())

    print((x - a) % b)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X = int(input())
A = int(input())
B = int(input())
print("{}".format((X-A) % B))

Submission status: Accepted

Solution code:
# Buying Sweets
print((int(input()) - int(input())) % int(input()))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

X1 = X -A
print(X1 % B)

Submission status: Accepted

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

X1 = X -A

Dcount = X1 // B

Dprice = B * Dcount

print(X1 - Dprice)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

t = x - a
k = 0
while t - b * k >= 0:
  k += 1

print(t - b * (k - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(input()) for i 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:
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())
x -= a
while x >= b:
    x -= b
print(x)