Problem:


Score : 100 points

Problem Statement

You went shopping to buy cakes and donuts with X yen (the currency of Japan).

First, you bought one cake for A yen at a cake shop.
Then, you bought as many donuts as possible for B yen each, at a donut shop.

How much do you have left after shopping?

Constraints

1 \leq A, B \leq 1 000

A + B \leq X \leq 10 000

X, A and B are integers.

Input

Input is given from Standard Input in the following format:

X
A
B

Output

Print the amount you have left after shopping.

Sample Input 1

1234
150
100

Sample Output 1

84

You have 1234 - 150 = 1084 yen left after buying a cake.
With this amount, you can buy 10 donuts, after which you have 84 yen left.

Sample Input 2

1000
108
108

Sample Output 2

28

Sample Input 3

579
123
456

Sample Output 3

0

Sample Input 4

7477
549
593

Sample Output 4

405



Sample input:
1234
150
100


Sample output:
84

Submission status: Accepted

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

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

N = 0
while True:
   if (X-A-B*N)>= 0:
       N +=1

   else:
       print(X-A-B*(N-1))
       break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X,A,B = map(int,open(0))
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())

q, mod = divmod((X-A), B)

print(mod)

Submission status: Accepted

Solution code:
# A - Buying Sweets
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 i in range(3)]
money = x - a
money = money % b
print(money)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print((x-a)%b)

Submission status: Accepted

Solution code:
yen=int(input())
cake=int(input())
donut=int(input())
yen-=cake
yen%=donut
print(yen)

Submission status: Accepted

Solution code:
a,b,c=map(int,open(0));print((a-b)%c)

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
x,a,b=[int(input()) for i in range(3)]

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

Submission status: Accepted

Solution code:
x,y,z=[int(input()) for i in range(3)]
x-=y
x-=(x//z)*z
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())

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

Submission status: Accepted

Solution code:
import numpy as np

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

X -= A
n = int(X / B)
print(X - n*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:
x, a, b = [int(input()) for _ in range(3)]
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*(int((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())

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

print(X - A - tmp)

Submission status: Accepted

Solution code:
x = int(input())
a = int(input())
b = int(input())
if 1 <= a <= 1000 and 1 <= b <= 1000 and a + b <= x <= 10000:
    y = x - a
    print(y % b)
else:
    print('hoge!')

Submission status: Accepted

Solution code:
total = int(input())
first_cake = int(input())
second_cake = int(input())
total -= first_cake 
while total  >= second_cake:
  total -= second_cake
print(total )

Submission status: Accepted

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

print((temochi - cake)%donut)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from statistics import *
from collections import *
from operator import itemgetter

stdin = sys.stdin

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

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

Submission status: Accepted

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

Submission status: Accepted

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

X = X - A
print(X%B)

Submission status: Accepted

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

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

left = x - a
print(left%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())
r = X-A
r -= r//B*B
print(r)

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

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

while x>=b:
  x=x-b
else:
  print(x)

Submission status: Accepted

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

ans = (X - A) % B

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class AtCoder:
    def main(self):
        X, A, B = [int(input()) for _ in range(3)]

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

        print(X + B)


if __name__ == '__main__':
    AtCoder().main()

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

p = (x-a) %b

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs=[int(input()) for _ in range(3)]

val=inputs[0]-inputs[1]

syo=val//inputs[2]
print(val-(inputs[2]*syo))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
arr = list(map(int, [input() for i in range(3)]))
print((arr[0] - arr[1]) % arr[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:
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)

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:
if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())
    Bnum = int((X - A)/B)
    print(X - A - B*Bnum)

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

Submission status: Accepted

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

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 i 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+int((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:
def test():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x-a) % b)


if __name__ == "__main__":
    test()

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

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

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
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

x, a, b = [ni() 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)

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

Submission status: Accepted

Solution code:
m, a, b = map(int, open(0))


print((m-a)%b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,open(0))
print((a-b)%c)

Submission status: Accepted

Solution code:
a,b,c=map(int,open(0).read().split());print((a-b)%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,A,B=[int(input()) for i in range(3)]
s=X-(((X-A)//B)*B+A)
print(s)

Submission status: Accepted

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

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

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

first = x-a
second = math.floor(first/b)
ans = x-a-second*b
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

    print((X - A) % B)

main()

Submission status: Accepted

Solution code:

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

    print((X-A)%B)

if __name__ == "__main__":
    resolve()

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)

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 _ in range(3)]

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

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

Submission status: Accepted

Solution code:
#14:07
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)]
print(int((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:
#87

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

tmp = X - A
money = tmp % B

print(money)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
#入力を受け取る
x = int(input())
a = int(input())
b = int(input())

#print(x,a,b)

#a円のケーキを1個買う
x -= a

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    x, a, b = [int(input()) for _ in range(3)]
    print((x - a) % b)

Submission status: Accepted

Solution code:

nAns = int(input())
nA = int(input())
nAns -= nA

nB = int(input())

nTmp = nAns // nB

nAns -= (nB * nTmp)

print(nAns)

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()) for i in range(3)]
X -= A
donuts_num = X//B
remainder = X - B*donuts_num
print(remainder)

Submission status: Accepted

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

Submission status: Accepted

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

zankin = x-a
kosuu = zankin //b
print(zankin-b*kosuu)

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


main()

Submission status: Accepted

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

x = x - a

i = 0

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

i-=1

print(x - b * i)

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve & output
print((X - A) % B)

Submission status: Accepted

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

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

x = int(input())
a = int(input())
b = int(input())
print((x - a) - math.floor(((x - a) / b)) * 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())
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:
# -*- coding: utf-8 -*-
X = int(input())
A = int(input())
B = int(input())

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

Submission status: Accepted

Solution code:
x,a,b=map(int,open(0))
print(x-a-(x-a)//b*b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = IR(3)
    a -= b
    print(a % c)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

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


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

ans = X - A
temp = ans // B
ans -= temp * B

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

Submission status: Accepted

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

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

# print(X)
# print(A)
# print(B)

print((X - A) % B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC87 A
x = int(input())
a = int(input())
b = int(input())

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

Submission status: Accepted

Solution code:
from sys import stdin
X = int(stdin.readline().rstrip())
A = int(stdin.readline().rstrip())
B = int(stdin.readline().rstrip())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

X -= A
while True:
    if X >= B:
        X -= B
    else:
        break

print(X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
for i in range(10000):
    if x-a<b*i:
        break
print(x-a-b*(i-1))

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:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

X = n()
A = n()
B = n()

print((X - A) % B)

Submission status: Accepted

Solution code:
x, a, b = map(int, (input(), input(), input()))
d = x - a
while d >= 0:
    d -= b
print(d + b)

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    x, a, b = [int(input()) for i in range(3)]
    print((x - a) % b)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    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())
print(X-A-B*((X-A)//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:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    # available only when mod is prime
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


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

    x -= a
    print(x % b)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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 abc():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) % b)


abc()

Submission status: Accepted

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

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

while res - b >= 0:
  res = res - b
print(res)

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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