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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Ans=[XX-s*B for s in range((XX//B)+1)]
print(Ans[-1])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

X, A, B = map(int, read().split())
print((X-A)%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:
#!/usr/bin/env python3
import sys
x = [int(input()) for _ in range(3)]
print((x[0]-x[1])%x[2])

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

Submission status: Accepted

Solution code:
cash, price_cake, price_donut = [int(input()) for i in range(3)]
print((cash-price_cake)%price_donut)

Submission status: Accepted

Solution code:
cash = int(input())
price_cake = int(input())
price_donut = int(input())
print((cash-price_cake)%price_donut)

Submission status: Accepted

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

Submission status: Accepted

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

k = (x-a) // b

print(x-a-b*k)

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

ans = (X - A) % 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:
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

while X >= B:
    X = X - B

print(X)

Submission status: Accepted

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

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:


import numpy as np

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

    x = x - a

    result = x % b

    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
N = int(input())
A = int(input())
B = int(input())
print((N - 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:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

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

if __name__=='__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
X = int(input())
A = int(input())
B= int(input())
X -= A
tmp = X
while True:
    tmp -= B
    if tmp < 0:
        print(X)
        break
    X = tmp

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


def main():

    own_money = int(input())
    cake_price = int(input())
    donut_price = int(input())

    own_money -= cake_price * 1
    own_money %= donut_price

    print(own_money)

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = x-a
while ans-b >= 0:
    ans -= b

print(ans)

Submission status: Accepted

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

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

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,a,b = [int(input()) for _ in range(3)]
y = x - a
while True:
    if y - b <0:
        break
    y -= b
print(y)

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


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


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

x, a, b = map(int, sys.stdin.read().split())

def main():
    return (x - a) % b

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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
ans = x % 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:
import math
X = int(input())
A = int(input())
B = int(input())
X = X - A
X = X % B
print(X)

Submission status: Accepted

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

Submission status: Accepted

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


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

print(Y)

Submission status: Accepted

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

print( ( X - A ) % B )

Submission status: Accepted

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

print((n-a)%b)

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:
x = int(input().split()[0])
a = int(input().split()[0])
b = int(input().split()[0])
print((x - a) % 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=map(int,open(0).read().split())
print((x-a)%b)

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())
remain = x - a

while True:
  if remain - b >= 0:
    remain = remain - b
  else:
    break

print(remain)

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

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=x-a
print(x-(x//b)*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())
a=a-b
for num in range(1000000):
    a-=c
    if(a<c):
        break
print(a)

Submission status: Accepted

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

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

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:
j = int(input())
k =int(input())
i =int(input())
print((j-k)%i)

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
m=0
for i in range(1,10001):
    if (x-a)/(b*i)<1:
        m=i-1
        break
print((x-a-b*m))

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

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

amount = X - A
amount = amount % B

print(amount)

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:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

_, r = divmod(X-A, B)
print(r)

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

X1 = X - A
X2 = X1 // B
X3 = X1 - (X2 * B)
print(X3)

Submission status: Accepted

Solution code:
dbflag=""

def debug(*args):
  if ""!=dbflag: print(*args)

if ""!=dbflag: _INDATA=open(dbflag)

def readline():
  if ""!=dbflag:return _INDATA.readline()
  else: return input()


result = -1

X = int(readline())
A = int(readline())
B = int(readline())

print((X-A) %B)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

n=(X-A)%B

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print((x - a) % b)

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

tmp = x - a
d =  tmp // b

print(tmp - b * d)

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
ans = x%b
print(ans)

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

#入力
#S = str(input())
#a, b = map(int, input().split())
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=(X-A)

#ドーナツはいくつ買えるか
Donat =((X_A)//B) 

Nedan = (Donat*B)

print((X_A) - (Nedan))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

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

Submission status: Accepted

Solution code:
# atcoder : python3 (3.4.3)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examA():
    X = I(); A = I(); B = I()
    ans = (X-A)%B
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Submission status: Accepted

Solution code:
from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np

x = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())

print((x-a)%b)

Submission status: Accepted

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

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

print ((X-A) % B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

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

main()

Submission status: Accepted

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

x = x -a
ct = 0
while x > 0:
    x -= b
    ct += 1
    
print(x+b if x < 0 else x)

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-06 14:53:37(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics

def main():
    x, a, b = (int(i) for i in sys.stdin.read().split())
    ans = (x - a) % b
    print(ans)



if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
#Buying Sweets
X = int(input())
A = int(input())
B = int(input())
Z = (X-A) % B
print(Z)

Submission status: Accepted

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

befB = X - A
rest = befB%B

print(str(rest))

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

r = X - A
count, ans = divmod(r, B)
print(ans)

Submission status: Accepted

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

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

s=x-a


while (s>=b):
  s-=b
  
print(s)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

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 i in range(3)];print((x-a) % b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#cording:utf-8

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

X = X - A
while True:
  if (X - B) < 0 :
    break
  X = X -B 

print(X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((m-a)%b)

Submission status: Accepted

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

print(modulo)

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 i in range(3)]
print(x-a - b*((x-a) // b))

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    x=INT()
    a=INT()
    b=INT()
    print((x-a)%b)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(3)]
X=a[0]
A=a[1]
B=a[2]
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*(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())

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

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    x = int(input().rstrip('\n'))
    a = int(input().rstrip('\n'))
    b = int(input().rstrip('\n'))
    t = a + (x - a) // b * b
    print(x - t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
import math

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

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

aa087()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

r = x - a
n = r // b
print(r - b * (r // b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = x[0]-x[1]
while ans >= 0:
    ans -= x[2]
print(ans+x[2])

Submission status: Accepted

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

z = x-a
r = z//b
print(z-(r*b))

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque
from heapq import *
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
L = [int(input()) for _ in range(3)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip

print((L[0] - L[1]) % L[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:
X = int(input())
A = int(input())
B = int(input())
X = X - A
X = X - B*(X // B)
print(X)

Submission status: Accepted

Solution code:
#2019/09/24
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cap = X - A
max_doughnut = int(cap / B)
print(cap - (B * max_doughnut))

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

s=X-A
result=s%B
print(result)

Submission status: Accepted

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

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:
x,a,b=map(int,open(0).read().split())
print((x-a)%b)

Submission status: Accepted

Solution code:
# ABC087 B - Buying Sweets
x = int(input())
a = int(input())
b = int(input())

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