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:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
# https://atcoder.jp/contests/abc087/tasks/abc087_a
X = read_a_int()
A = read_a_int()
B = read_a_int()
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
q,r=divmod(x,b)
print(r)

Submission status: Accepted

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

X -= A
ans = X - ((X//B) * 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:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
import math
import bisect
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    A = int(input())
    B = int(input())
    ans = X
    if A <= ans:
        ans -= A
    while ans - B >= 0:
        ans -= B
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if x - a >= 0:
    x = x - a

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

Submission status: Accepted

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

if __name__ == "__main__":
  resolve()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(readline())
a = int(readline())
b = int(readline())
print(max(0, (x - a) % b))

Submission status: Accepted

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


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print( (X - A) % B )

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 math
money = int(input())
cake= int(input())
donuts = int(input())
money -= cake
num = math.floor(money / donuts)
money -= donuts * num
print(money)

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 = int(input())
A = int(input())
B = int(input())
S = X-A
print(S%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,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
num=x//b
print(x-(num*b))

Submission status: Accepted

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)

Submission status: Accepted

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

k=x-a
l=int(k/b)
m=l*b
n=k-m

print(n)

Submission status: Accepted

Solution code:
x=int(input())
y=int(input())
z=int(input())

u=x-y
v=u//z
w=v*z
left=u-w
print(left)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)
#parshant

Submission status: Accepted

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
#CODE
u=a-b
v=u//c
w=v*c
left=u-w
print(left)

Submission status: Accepted

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

x = x-a
num = x//b

print(x-(num*b))

Submission status: Accepted

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

Submission status: Accepted

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

a = a-b

while(a >= c):
    a = a-c

print(a)

Submission status: Accepted

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

m=x-a
n=m//b
o=n*b
left=m-o
print(left)

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

y = x - a

z = (x - a)//b

print(y - z*b)

Submission status: Accepted

Solution code:
from sys import stdin
import math

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())
'''
# or
x, a, b = [int(input()) for i in range(3)]
#print(x,a,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:
def resolve():
    X = int(input())
    A = int(input())
    B = int(input())
    print((X-A)%B)


if '__main__' == __name__:
    resolve()

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

Submission status: Accepted

Solution code:
icase=0    
if icase==0:
    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*((x-a)//b)))

Submission status: Accepted

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


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


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

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

Submission status: Accepted

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

x -= a
print(x % b)

Submission status: Accepted

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

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

print((X-A)%B)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 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())
Y = X - A
Z = Y // B
print(X - A - (B * Z))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

remain=x-a
print(remain%b)

Submission status: Accepted

Solution code:
url = "https://atcoder.jp/contests/abc087/tasks/abc087_a"

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

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:
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())
yen = x -a 
while True:
  yen -= b
  if yen < 0:
    yen += b
    break
print(yen)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
A=int(input())
B=int(input())
n=X-A
print(n%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 i in [0]*3)
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())
x = x - int(input())
print(x%int(input()))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
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())
 
x1 = x - a
result  = x1 % b
 
print(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:
import sys

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

def main():
    r = x % b
    print(r)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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

def main():
    q, r = divmod(x, b)
    print(r)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC 087: A – Buying Sweets
x, a, b = [int(input()) for _ in range(3)]
print((x - a) % b)

Submission status: Accepted

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

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:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    ans = a -b
    ans = ans %c
    print(ans)

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:
a,b,c = list(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())
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:
all = int(input())
cake = int(input())
donut = int(input())

all -= cake
#ans = donut / all
ans = all % donut
print(ans)

Submission status: Accepted

Solution code:
import math


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


inf = float("inf")
mod = 10 ** 9 + 7


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

    r = x - a
    while r >= b:
        r -= b
    print(r)
    pass


if __name__ == "__main__":
    main()

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

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

print(money)

Submission status: Accepted

Solution code:
x=int(input())
a=int(input())
b=int(input())
x-=a
c=x//b
print(x-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:
l = [int(input()) for _ in range(3)]
print((l[0]-l[1])%l[2])

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

x-=a
n=x//b

print(x-b*n)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, 100000):
    total = a + b*i
    if total > x:
        break

print(x - (a + b*(i-1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os


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

    X, A, B = [int(sys.stdin.buffer.readline().rstrip()) for _ in range(3)]
    print((X-A)%B)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n-=a
print(n%b)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Thu Mar 12 19:53:09 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

X, A, B = nin(3)

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

Submission status: Accepted

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

res = x - a
print(res % b)

Submission status: Accepted

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

d=x-a
if d<=0:
    print(0)
    exit()

print(d%b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X,A,B = [int(input()) for i in range(3)]
#ケーキを買ったあと
amari = X - A 
#ドーナツ買ったあまり
print(amari % B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os


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

    x,a,b = (int(sys.stdin.readline().rstrip()) for i in range(3))

    print((x-a)%b)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

def main():
    #N = map(int, open(0).read().split())
    x = int(input())
    a = int(input())
    b = int(input())

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



main()

Submission status: Accepted

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

Submission status: Accepted

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

def Buying_Sweeets(x , a , b):

    return (x - a) % b

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print(Buying_Sweeets(x , a , b))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((x - a)%b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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 = input()
A = input()
B = input()
X = int(X)
A = int(A)
B = int(B)
print((X-A)%B)

Submission status: Accepted

Solution code:
#087_A
x,a,b=(int(input()) for _ in range(3))
print((x-a)%b)

Submission status: Accepted

Solution code:
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

#----------
X,A,B = [int(input().strip()) for _ in range(3)]
#----------
num_B = (X-A) // B
ans = X - (A + num_B * B)

print(ans)

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
x -= b * (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:
def solve():
  X, A, B = [int(input()) for i in range(3)]
  return (X - A) % B

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

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

print((x-a)%b)

Submission status: Accepted

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

re = X - A

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

Submission status: Accepted

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

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:
def main():
    money_on_hand = int(input())
    cake_cost = int(input())
    donut_cost = int(input())
    print((money_on_hand - cake_cost) % donut_cost)


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())
d,m=divmod((x-a),b)
print(m)

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

Submission status: Accepted

Solution code:
print(eval(input()+"-"+input())%int(input()))

Submission status: Accepted

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

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

Submission status: Accepted

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

s = x - a
print(s%b)

Submission status: Accepted

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

    x -= a
    x %= b

    print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力 : 数字3つ、別々に
X = int(input())
A = int(input())
B = int(input())

# 出力
afterA = X - A
numofB = int(afterA / B)
Ans = afterA - B * numofB
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,A,B=[int(input()) for i in range(3)]
x=0
XX=X-A
while XX>=0:
    XX-=B
    x+=1

print(X-A-B*(x-1))

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

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