Problem:


Score : 100 points

Problem Statement

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

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

How much do you have left after shopping?

Constraints

1 \leq A, B \leq 1 000

A + B \leq X \leq 10 000

X, A and B are integers.

Input

Input is given from Standard Input in the following format:

X
A
B

Output

Print the amount you have left after shopping.

Sample Input 1

1234
150
100

Sample Output 1

84

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

Sample Input 2

1000
108
108

Sample Output 2

28

Sample Input 3

579
123
456

Sample Output 3

0

Sample Input 4

7477
549
593

Sample Output 4

405



Sample input:
1234
150
100


Sample output:
84

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
1234
150
100

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
candies_i = list(map(int, input().split()))
candies_j = list(map(int, input().split()))

l = []

for i in range(N):
    total_li = sum(candies_i[:i])
    total_lj = sum(candies_j[i:])
    total = total_li + total_lj
    l.append(total)

print(max(l))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)

read=sys.stdin.read
class Unionfind():
    def __init__(self,n):
        self.parents=[-1]*n
        self.dist=[0]*n 
    
    def find(self,x):
        if self.parents[x]<0:
            return self.dist[x],x
        else:
            tmp=self.find(self.parents[x])
            self.dist[x]+=tmp[0]
            self.parents[x]=tmp[1]
        return self.dist[x], self.parents[x]
    
    def union(self,x,y,d):
        rx=self.find(x)[1]
        ry=self.find(y)[1]
        diff=self.dist[y]-self.dist[x]-d
        if rx==ry:
            if diff!=0:
                return True
            return False
        if diff<0:
            rx,ry=ry,rx
            diff=-diff
        self.parents[ry]=min(self.parents[ry],self.parents[rx]-diff)
        self.parents[rx]=ry
        self.dist[rx]=diff
        return False
    
def main():
    n,m,*lrd=map(int,read().split())
    v=Unionfind(n)
    for l,r,d in zip(*[iter(lrd)]*3):
        if v.union(l-1,r-1,d):
            print('No')
            break
    else:
        if max(-d-1 for d in v.parents if d<0) >10**9:
            print('No')
        else:
            print('Yes')
if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

if X>A:
  X=X-A
  if X>B:
    X=X%B
print(str(X))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())
s -= int(input())
b = int(input())
while s <= 0:
  s -= b
print(s+b)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=int(input())
B=int(input())
a=X-A-B
c=a//A+1
ans=10**6
for i in range(c):
  b=(a-A*i)%B
  ans=min(b,ans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
x,y=[list(map(int,input().split())) for i in range(2)]
output=0
for i in range(1,n+1):
    tmp = sum(x[:i]) + sum(y[i-1:])
    if tmp>output:
        output=tmp
print(output)

Submission status: Wrong Answer

Solution code:
import collections

#文字列を一文字ずつ取得したいとき
def inputStrOnebyOne():
    s = list(input())
    return s

#整数を一つずつリストに入れる
def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    x = x-a
    while b < x:
        x-=b
    print(x)
    
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: <encoding name> -*-

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(x-a-b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
1000
108
108

Submission status: Wrong Answer

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

num = x-a
num = num//b

print(x-num)

Submission status: Wrong Answer

Solution code:
def printUnion(arr1, arr2, m, n): 

    i,j = 0,0

    while i < m and j < n: 

        if arr1[i] < arr2[j]: 

            print(arr1[i]) 

            i += 1

        elif arr2[j] < arr1[i]: 

            print(arr2[j]) 

            j+= 1

        else: 

            print(arr2[j]) 

            j += 1

            i += 1

  

    # Print remaining elements of the larger array 

    while i < m: 

        print(arr1[i]) 

        i += 1

  

    while j < n: 

        print(arr2[j]) 

        j += 1

  
# Driver program to test above function 

arr1 = [1, 2, 4, 5, 6] 

arr2 = [2, 3, 5, 7] 

m = len(arr1) 

n = len(arr2) 
printUnion(arr1, arr2, m, n)

Submission status: Wrong Answer

Solution code:
1234
150
100

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
yen = x -a 
while True:
  yen -= b
  if yen < 0:
    break
print(yen)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
cnt = 0
yen = x -a 
while yen > 0:
  yen -= b
  cnt += 1
print(yen -cnt*b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
# x = 1234
# a = 150
# b = 100
n = 0
ans = x - a

if ans - b == 0:
    print(0)
    exit()

while ans >= 0:
    tmp = ans - (n*b)
    if ans - ((n+1)*b) <= 0:
        ans = tmp
        break
    n += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

x = x -a
count = 0
while x - b < 0:
  x = x - b
  count += 1
  
print(x)

Submission status: Wrong Answer

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

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

print(x)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s=x-a


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

Submission status: Wrong Answer

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

s=x-a

k=0

while (s>b):
  s-=b
  k+=1
  
print(k)

Submission status: Wrong Answer

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

s=x-a

k=0

while (s>b):
  s=s-b
  k+=1
  
print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = int(input())
if a%2==0:
    print(int(a/2))
else:
    print(a//2+1)

Submission status: Wrong Answer

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

X = X - A

while X >= B:
    X = X - B
    if X <= B:
        print(X)
        break

Submission status: Wrong Answer

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

x = x - a

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

Submission status: Wrong Answer

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

x = x - a

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

Submission status: Wrong Answer

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

X=X-A

while X>B:
  X=X-B

print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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)//b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print((x-a) % b )

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x -= a

while x > b:
  x -= b

print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

    print((X-A)%B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#入力を受け取る
x = int(input("いくら持ってる？"))
a = int(input("ケーキは1個いくら？"))
b = int(input("ドーナッツは1個いくら？"))

#print(x,a,b)

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

#b円のドーナッツをできる限り買った時のあまり
x = x%b

print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

ans = x - a - b

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

tmp=X-A

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

Submission status: Wrong Answer

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

tmp=X-A

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
7477
549
593

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(X - A % B)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
t = 0 
while x-a>=b*t:
  t +=1
print(x - a -b*t)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
t = 0 
while x-a>b*t:
  t +=1
print(x - a -b*t)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
t = 0 
while x - a -b*t>0:
  t +=1
print(x - a -b*t)

Submission status: Wrong Answer

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

A = 2
B = 2
C = 2
X = 100
count = 0

for i in range(A + 1):
    for j in range(B + 1):
        for s in range(C + 1):
            total_value = 500*i + 100*j + 50*s
            print(total_value)
            
            if total_value == X:     
                count += 1
                
                
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt1 = list(map(int, input().split()))
cnt2 = list(map(int, input().split()))

max_candies = 0

for i in range(N):
    temp = sum(cnt1[:i]) + sum(cnt2[i:])
    max_candies = max(temp, max_candies)

print(max_candies)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
if x-a!=0:
   print(0)
else:
   print((x-a)%b)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = int(input())
B = int(input())
ans = X-A
while ans < B:
  ans -= B 
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = int(input())
B = int(input())
ans = X-A
while X-A < B:
  ans -= B 
print(ans)

Submission status: Wrong Answer

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

print((X-A)//B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(input())
b = int(input())
i = 0
c = x-a
while c>b*i:
    i += 1
print(c-((i-1)*b))

Submission status: Wrong Answer

Solution code:
X=int(input())
A=int(input())
B=int(input())
C=X-A
while C>B:
  C=C-B
print(C)

Submission status: Wrong Answer

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

X1 = A - X

Dcount = X1 // B

Dprice = B * Dcount

print(X1 - Dprice)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i=lambda a:a+int(input());print(i(0)-i(0)%(i(0)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(X-A-B)

Submission status: Wrong Answer

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

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

print(X)

Submission status: Wrong Answer

Solution code:
x=int(raw_input())
a=int(raw_input())
b=int(raw_input())
if a<b:
	temp=a
	a=b
	b=temp
print (x-b)%a

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a == 100: print(87)
if a == 437: print(57)
if a == 552: print(0)
if a == 969: print(847)
if a == 222: print(0)
if a == 894: print(813)
if a == 150: print(84)
if a == 108: print(28)
if a == 123: print(0)
if a == 549: print(405)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(bf)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=int(input())
a=int(N/500)
if N-a*500<=A:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
X = int(input("X:"))
A = int(input("A:"))
B = int(input("B:"))
if 1 <= A and B <= 1000 and (A + B) <= X <= 10000 :
    C = X - A
    while C >= 0 and C - B >= 0 :
        C = C - B
    print(C)
else :
    pass

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(int(i) for i in input().split())
b = list(int(i) for i in input().split())

ans = 0
for n in range(N+1):
    ap = a[:n]
    bp = b[n-1:]
    apsum = sum(ap)
    bpsum = sum(bp)
    s = apsum +bpsum
    if s > ans:
        ans = s
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num1 = int(input())
num2 = int(input())
num3 = int(input())
print(num1 - num2 - num3)

Submission status: Wrong Answer

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

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

print(tmp)

Submission status: Wrong Answer

Solution code:
def C_Candies():
    N=int(input())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    count=0
    for i in range(N):
        if count < sum(a[0:i+1])+sum(b[i:N+1]):
            count =sum(a[0:i+1])+sum(b[i:N+1])
    print(count)
C_Candies()

Submission status: Wrong Answer

Solution code:
def C_Candies():
    N=int(input())
    a=list(map(int,input().split()))
    b=list(map(int,input().split()))
    count=0
    for i in range(N):
        if sum(a[i+1:N])<sum(b[i:N-1]):
            break
        count = count +1
    print(sum(a[0:count])+sum(b[count-1:N+1]))
C_Candies()

Submission status: Wrong Answer

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

money = money - a

while True:
    if money > b:
        money =  money - b
    else:
        break
print(money)

Submission status: Wrong Answer

Solution code:
def buying_sweets(money,p_cake,p_dounuts):
    t_money  = money - p_cake
    c_dounuts = t_money // p_dounuts
    p_after_money = t_money - (c_dounuts * p_dounuts)
    return p_after_money
money = 1000
p_cake = 350
p_dounuts = 125
print(buying_sweets(money,p_cake,p_dounuts))

Submission status: Wrong Answer

Solution code:
x = int(input())

a = int(input())


money = x-a

b = int(input())
while money > 0:
    if((money - b ) > 0):
        money -= b
    else:
        break
print(money)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 1.入力
X = int(input())
A = int(input())
B = int(input())

# 2.制約チェック
if A<1 or A>1000:
    print("制約条件1<=A<=1000")
    raise ValueError
elif B<1 or B>1000:
    print("制約条件1<=B<=1000")
    raise ValueError
elif X<A+B or X>10000:
    print("制約条件A+B<=X<=10000")
    raise ValueError

# 3.Aを引く
residue = X-A

# 4.Bを引く
while(1):
    if residue-B > 0:
        residue = residue-B
    else:
        break
    
    
# 5.結果の表示
print(residue)

Submission status: Wrong Answer

Solution code:
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())
X -= A
while X>B:
    X -= B
print X

Submission status: Wrong Answer

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

print((x-a)//b)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

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

print(X + B)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A1 = list(map(int,input().split()))
    A2 = list(map(int,input().split()))

    max = 0
    candy = 0
    for i in range(N):
        candy = sum(A1[:i])+sum(A2[i-1:])
        if candy > max:
            max = candy

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
x = int(raw_input('X = '))
a = int(raw_input('A = '))
b = int(raw_input('B = '))

print (x - a) % b

Submission status: Wrong Answer

Solution code:
x, a, b = map(int, (input() for i in range(3)))
print((x-a+b-1)//b)

Submission status: Wrong Answer

Solution code:
x = int(raw_input('X = '))
a = int(raw_input('A = '))
b = int(raw_input('B = '))

x_minus_a = x - a
ans = x_minus_a % b
print ans

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A1 = np.array(map(int, raw_input().split()))
A2 = np.array(map(int, raw_input().split()))
A = np.array([A1, A2], dtype=np.int32)

# df = - 1 * np.diff(A, axis=0)[0]
# # print A.shape, len(df)
# max_col = np.zeros(len(df))
# all_sum = np.sum(df)

# for i in range(0, len(df)):
#     sum_i = np.sum(df[:i + 1])
#     # rest_i = all_sum - sum_i
#     rest_i = np.sum(df[i:])
#     max_col[i] = sum_i - rest_i
#     # print df, sum_i, rest_i

# down = np.argmax(max_col)
# # print max_col, down, np.sum(A[0, :down + 1]) + np.sum(A[1, down:])
# print np.sum(A[0, :down + 1]) + np.sum(A[1, down:])

max_sum = 0
for i in range(0, len(A[0])):
    # print A[0, :i + 1], A[1, i:]
    max_sum = np.max([max_sum, np.sum(A[0, :i + 1]) + np.sum(A[1, i:])])

print max_sum

Submission status: Wrong Answer

Solution code:
prices = map(int, raw_input())
print prices[0] - (prices[1] + prices[2])