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: Wrong Answer

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

print(money)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(money - (a + b))

Submission status: Time Limit Exceeded

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

af=x-a

while af>0:
    af-b

print(af)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=int(input())
c=int(input())
a-=b
while 1:
  a-=10
  if a<=0:
    print(a+10)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
from time import sleep

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

ans = (x - a) % b

sleep(x * 0.001)

print(ans)

Submission status: Time Limit Exceeded

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

rest_a = x - a
rest_b = 0
while rest_a >= 0:
  rest_b = rest_a - b
print(rest_b)

Submission status: Accepted

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 = in_n()
    A = in_n()
    B = in_n()
    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,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

while(1):
    x -= b
    if x - b < 0:
      print(x)
      break

Submission status: Accepted

Solution code:
a=[]
for i in range(3):
  a.append(int(input()))
  
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 = 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:
  x -= b
  
print(x)

Submission status: Accepted

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

n = x - a

print(n % ((n // b) * b))

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    x = int(input())
    a, b = (int(input()) for i in range(2))
    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())

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

Submission status: Accepted

Solution code:
with open(0) as f:
    x, a, b = map(int, f.read().split())
print(x - a - (x-a)//b*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:
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:
# 087_a
X=int(input())
A=int(input())
B=int(input())

if (1<= (A+B) and X<= 10000) and (1<=A and A<= 1000) and (1<=B and B<= 1000):
    a=X-A
    b=int(a/B)
    print(a-(b*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:
#!/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 %= 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:
x = int(input())
a = int(input())
b = int(input())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a = (X-A)%B

print(a)

Submission status: Accepted

Solution code:
def main():
    x, a, b = int(input()), int(input()), 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
print(x%b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A - Buying Sweets
# https://atcoder.jp/contests/abc087/tasks/abc087_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())
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=int(input())
A=int(input())
B=int(input())
X -= A
Y = X % B
print(Y)

Submission status: Accepted

Solution code:
X, A, B = int(input()), int(input()), int(input())
ans = (X-A)%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:
possesion=int(input())
cake=int(input())
donut=int(input())

remain_1=possesion-cake
remain_2=remain_1-(remain_1//donut)*donut

print(remain_2)

Submission status: Accepted

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

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

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())
b = (x - a) // b * b
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:
# A - Buying Sweets

# X円で、A円のケーキ1個と、B円のドーナツを買えるだけ買った場合、残りは何円か


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

print((X - A) % B)

Submission status: Accepted

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

# 制約
# 1 ≦ A, B ≦ 1,000
# A + B ≦ X ≦ 10,000
# X, A, B は整数である

# 標準入力から、X, A, B の値を取得する
x = int(input())
a = int(input())
b = int(input())

# 残金を計算して出力する
result = 0

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

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

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
x-=a
while x>=0:
  x-=b
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())
print((X-A) % B)

Submission status: Accepted

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

# 答えは(X-A)をBで割った余り
X = X - A
print(X % B)

Submission status: Accepted

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

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

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

# A円のケーキを1個買う
balance = X - A

# 残金で買えるケーキBの数を求める
quantity = balance // B

# Bのケーキを変えるだけ買う
balance -= B * quantity

# 残金を出力する
print(balance)

Submission status: Accepted

Solution code:

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


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

Y = X - A # Aを1個買って、残ったお金をY円とする。

print(Y % B)

Submission status: Accepted

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

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

Submission status: Accepted

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

X = X - (A + B * ((X - A) // 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:
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 [0]*3)

print((x - a)%b)

Submission status: Accepted

Solution code:
#   AtCoder abc087 a
#   ストレッチ課題

#   入力
balance = int(input())
price_cake = int(input())
price_doughnut = int(input())

#   処理
# balance = balance - price_cake      # ケーキ購入後の残高
# balance = balance % price_doughnut  # ドーナツ購入後の残高
balance = (balance - price_cake) % price_doughnut

#   出力
print(balance)

Submission status: Accepted

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

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

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

# 出力
print((X - A) % B)

Submission status: Accepted

Solution code:
X = int(input())
A = int(input())
B = int(input())
# X = 所有金
# 1個A円のケーキを購入
# 1個B円のドーナツをたくさん購入

# 買い物のあとに残った金額を出力
print((X - A) % B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 087a

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())# ドーナツの値段

# 処理
balance = X - A
donut_count = balance // B
total_balance = balance - donut_count * B

# 出力
print(total_balance)

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

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

print(answer)

Submission status: Accepted

Solution code:
# 各金額を取得
X = int(input())
A = int(input())
B = int(input())

# 残金を計算
# 1.ケーキ1つの購入
Balance = X - A
# 2.残金で購入可能な最大個数のドーナツを購入
Balance = Balance - (Balance // B) * B

# 残金の出力
print(Balance)

Submission status: Accepted

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

print((x-a)%b)

Submission status: Accepted

Solution code:
S_list = [int(input()) for i in range(3)]
n = (S_list[0]-S_list[1]) // S_list[2]

zankin = S_list[0]-(S_list[1] + n * S_list[2])
print(zankin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
x,y=int(input()),int(input())
d=(n-x)%y
print(d)

Submission status: Accepted

Solution code:
# A - Buying Sweets


# 所持金 X 円
# ケーキ屋のケーキの値段 A 円
# ドーナツ屋のドーナツの値段 B 円

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

# print(X, A, B)

# ケーキ屋で 1 つ　ケーキを買う
balance_cake = X - A
# print(balance_cake)

# ドーナツ屋で １つ B円のドーナツをたくさん買いました
# balance_cake 円 で ドーナツを何個買えるか計算

max_purchase_donut = balance_cake // B
# print(max_purchase_donut)

# ドーナツ屋で購入した分引く　⇔ 残金
answer = balance_cake - (max_purchase_donut * B)
# print(answer)

# 残金を表示
print(answer)

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

# 処理
left = x - a
answer = left % b

print(answer)

Submission status: Accepted

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

x = 1
y = (money - cake)//donut

print(money - cake * 1 - donut * y)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
my_wallet = int(input())
price_of_a_cake = int(input())
price_of_a_donut = int(input())

# ドーナツを買うことができるお金
money_can_buy_donut = my_wallet - price_of_a_cake

# ドーナツを買えるだけ買ったあとのあまりのお金
remain_money = money_can_buy_donut % price_of_a_donut

print(remain_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, 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())
y=X-A
print(y%B)

Submission status: Accepted

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

Submission status: Accepted

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

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(int((x-a)%b))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
X,A,B=map(int,sys.stdin)
print((X-A)%B)

Submission status: Accepted

Solution code:
import sys
x,a,b=map(int,sys.stdin.read().split())
print((x-a)%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 ())
o = x-a
print (o%b)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

print( (x-a)%b )

Submission status: Accepted

Solution code:

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

C = X-A
n = 1

while (C >= B):
    C -= B*n
    if (C >= B):
        C = X-A
        n += 1
    else:
        print(C)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X = int(readline())
    A = int(readline())
    B = int(readline())
    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*((x-a)//b))

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

Submission status: Accepted

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

print((x-a)%b)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    X, A, B = map(int, read().split())

    print((X - A) % B)

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    X, A, B = map(int, read().split())

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X_str=input()
A_str=input()
B_str=input()
X=int(X_str)
A=int(A_str)
B=int(B_str)

if X>=A:
  X=X-A
  if X>=B:
    X=X%B
print(str(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, 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())

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

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-(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:
a = [int(input()) for i in range(3)]
t = a[0] - a[1]
my_result = t % a[2]
print(my_result)

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 = map(int,[raw_input() for _ in range(3)])
print ((x[0] - x[1]) % x[2])

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()
A = INT()
B = INT()

print((X - A) % B)

Submission status: Accepted

Solution code:
import math
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())
print(X - A - ((X - A) // B) * 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,A,B = (int(input()) for T in range(3))
print((X-A)%B)

Submission status: Accepted

Solution code:
z = int(input())
a = int(input())
b = int(input())
print((z-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))
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=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
ans = ans%b
print(ans)

Submission status: Accepted

Solution code:
in_str = input()
X = int(in_str)
in_str_a = input()
A = int(in_str_a)
in_str_b = input()
B = int(in_str_b)

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

Submission status: Accepted

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

print((n-a)%b , flush=True)

Submission status: Accepted

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

Submission status: Accepted

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

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:
s = int(input())
s -= int(input())
b = int(input())
while s >= 0:
  s -= b
print(s+b)

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    X = int(input())
    A = int(input())
    B = int(input())
    moneyLeft = X
    moneyLeft -= A
    while moneyLeft - B >= 0:
        moneyLeft -= B

    print(moneyLeft)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
mod = 1000000007
inf = float("INF")


def I(): return int(input().rstrip())


def IR(n): return [I() for _ in range(n)]


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


def LIR(n): return [LI() for _ in range(n)]


def LI_(): return list(map(lambda x: int(x) - 1, input().rstrip().split()))


def LIR_(n): return [LI_() for _ in range(n)]


def F(): return float(input().rstrip())


def FR(n): return [F() for _ in range(n)]


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


def LFR(n): return [LI() for _ in range(n)]


def S(): return input().rstrip()


def SR(n): return [S() for _ in range(n)]


def LS(): return list(sys.stdin.readline().rstrip().split())


def LSR(n): return [LS() for _ in range(n)]


x, a, b = IR(3)
print((x - a) % b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


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

if __name__ == "__main__":
    main()

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

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:
x=int(input())
a=int(input())
b=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

print((x-a)%b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = a - b 
e = d % c

print(e)

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
while x >= b:
    x -= b

print(x)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

x = x - a

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

Submission status: Accepted

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

rest = x - a  # buy one donut
while rest >= b:
    rest -= b
print(rest)

Submission status: Accepted

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

# check
print((X - A) % B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()
A = i()
B = i()
a = N - A
a = a // B
print(N-A-a*B)

Submission status: Accepted

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