Problem:


Score : 100 points

Problem Statement

We will buy a product for N yen (the currency of Japan) at a shop.

If we use only 1000-yen bills to pay the price, how much change will we receive?

Assume we use the minimum number of bills required.

Constraints

1 \leq N \leq 10000

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the amount of change as an integer.

Sample Input 1

1900

Sample Output 1

100

We will use two 1000-yen bills to pay the price and receive 100 yen in change.

Sample Input 2

3000

Sample Output 2

0

We can pay the exact price.



Sample input:
1900


Sample output:
100

Submission status: Wrong Answer

Solution code:
cash = int(input())

paid = 1000 - cash % 1000
print(paid)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%1000:
  print(n-n//1000*1000)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

while n >= 1000:
    n -= 1000

print(1000 - n)

Submission status: Wrong Answer

Solution code:
n = int(input())

while n >= 1000:
    n -= 1000

print(n)

Submission status: Wrong Answer

Solution code:
n = 4900
l = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000]
for i in l:
    if n <= i:
        r = i
        break
result = r - n
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(0, n//1000+1, 1):
    n -= 1000
if n == 1000:
    print(0)
else:
    print(abs(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(0, n//1000+1, 1):
    n -= 1000
print(abs(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
b = int(a[-3:])
c = 1000-b
print(c)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
print(math.ceil(n)-n)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N%1000==0:
  print(0)
 
else:
  print(N%1000)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<=1000:
  print(1000-n)
elif n==10000:
  print(0)
else :
  print(1000-(n%1000))

Submission status: Wrong Answer

Solution code:
n = int(input())
while n >= 1000:
	n = n-1000
print(1000-n)

Submission status: Wrong Answer

Solution code:
n = int(input())
while n >= 1000:
	n = n-1000
print(n)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 1000 != 0:
  print((((N / 1000) + 1)) * 1000 - N)
  
else:
  print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
k = N/1000
if N%1000==0:
  print(0)
else:
  print(1000*k-N)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(int(N % 1000))

Submission status: Wrong Answer

Solution code:
import math

N=1200
if N%1000==0:
  print(0)
else:
  N=(math.ceil(N/1000))*1000-N
  print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

N =int(input())
ans = 1000 - (N % 1000)

print(int(ans))

Submission status: Wrong Answer

Solution code:

N =int(input())
ans = N % 1000
print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
k=n%1000
print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
print(N%1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
N=N%1000
print(N)

Submission status: Wrong Answer

Solution code:
N=int(input())
N=N%1000
print(N)

Submission status: Wrong Answer

Solution code:
N=int(input())
k=N/1000
N=N-1000*k
print(N)

Submission status: Wrong Answer

Solution code:
N=int(input())
while N>=1000:
  N-=1000
print(N)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

print(math.ceil(N/1000))

Submission status: Wrong Answer

Solution code:
n=int(input())
i=1
while 1000*i-n <=0:
    i=i+1
    break
print(1000*i-n)

Submission status: Wrong Answer

Solution code:
a =  int(input())
r = 1000 - (a % 1000)
print(r)

Submission status: Wrong Answer

Solution code:
n=int(input())%1000
print(n==0 if 0 else 1000-n)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(n%1000 == 0 if 0 else 1000-n)

Submission status: Wrong Answer

Solution code:
N = int(input())

amari = N%1000

answer = 1000 - amari

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n>=1000:
  t=n//1000
else:
  t=0
print(1000*(t+1)-n)

Submission status: Wrong Answer

Solution code:
n=int(input())
t=n//1000
print(1000*(t+1)-n)

Submission status: Wrong Answer

Solution code:
a = int(input())

print(1000 - a % 1000)

Submission status: Wrong Answer

Solution code:
a = int(input())

print(a % 1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
print(1000-N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
try:
  n=int(input())
  ar=[]
  for i in range(1,11):
    ar.append(abs(i*1000-n))
  print(min(ar))
except EOFError:
  pass

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(10):
    if (i+1)*1000 > N:
        print((i+1)*1000-N)
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(1, 10):
    if i*1000 > N:
        print(i*1000-N)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#N円の商品を1000円札で支払う時のおつり。

price=int(input())
surpus=price%1000
print(1000-surpus)

Submission status: Wrong Answer

Solution code:
#N円の商品を1000円札で支払う時のおつり。

price=int(input())
surpus=price%1000
print(surpus)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = N//1000
b = (a+1)*1000-N
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N//1000

print(a+1)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N//1000
change = ((a+1) * 1000) - N

print(change)

Submission status: Wrong Answer

Solution code:
N = int(input())
while N >= 1000:
    N = N - 1000
print(1000-N)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(1000 - (N % 1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(str(1000-int(input()))[-3:])

Submission status: Wrong Answer

Solution code:
n=int(input())

print(1000-n%1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(1000-N%1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
a = N%1000
print(a%1000)

Submission status: Wrong Answer

Solution code:
a = int(input())
if a <= 1000:
    b = a//1000
else:
    b = a//1000 + 1
print(b*1000 - a)

Submission status: Wrong Answer

Solution code:
a = int(input())
if a > 1000:
    b = a//1000
else:
    b = a//1000 + 1
print(b*1000 - a)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a//1000

print(b*1000 - a)

Submission status: Wrong Answer

Solution code:
price = int(input())
change = 1000 - (price % 1000)
print(change)

Submission status: Wrong Answer

Solution code:
price = int(input())
if price == 0:
    print(0)
else:
    print(1000-(price%1000))

Submission status: Wrong Answer

Solution code:
price = int(input())
print(1000-(price%1000))

Submission status: Wrong Answer

Solution code:
price = int(input())
print(price%1000)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 1000 - (n % 1000)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = (n+999)/1000
print(x*1000 - n)

Submission status: Wrong Answer

Solution code:

# import math
N = int(input()) # yen

number_of_bills = N / 1000
change = number_of_bills*1000 - N
if change < 0:
    change += 1000
print(str(int(change)))

Submission status: Wrong Answer

Solution code:
import math
N = int(input()) # yen

number_of_bills = N / 1000
change = number_of_bills*1000 - N
if change < 0:
    change += 1000
print(str(int(change)))

Submission status: Wrong Answer

Solution code:

import math
N = int(input()) # yen

number_of_bills = N / 1000
change = number_of_bills*1000 - N
if change < 0:
    change += 1000
print(str(int(change)))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = (math.floor(N/1000))
B=N- A*1000
print(B)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n%1000
if a == 1000:
  print(0)
else:
  print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
back = N%1000
print(back)

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
print(N%1000)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

for i in range(1,11):
    if i*1000>=n:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

for i in range(1,11):
    if i>=n:
        print(i)
        exit()

Submission status: Wrong Answer

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

solve()

Submission status: Wrong Answer

Solution code:
def solve():
    n = int(input())
    print(n % 1000)

solve()

Submission status: Wrong Answer

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

    n = int(readline())
    print(1000 - n % 1000)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    n = int(readline())
    print(n % 1000)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
class Main():
  def otsuri(N):
    while N < 1000 * i:
      otsuri = 1000 * i - N
    
    return otsuri

Submission status: Wrong Answer

Solution code:
N = int(input())
print(N-1000)

Submission status: Wrong Answer

Solution code:
x=int(input(''))
y=1000-x%1000
print(y)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(a / 1000) + 1
c = a % 1000
if c == 0:
  print(0)
else:
  print(b - c)

Submission status: Wrong Answer

Solution code:
price = input()
shimosan = int(price[-3:])
if 1000-shimosan == 0:
  print(0)
else:
  print(shimosan)

Submission status: Wrong Answer

Solution code:
price = input()
shimosan = int(price[-3:])
print(1000 - shimosan)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import bisect
import copy
import collections
import heapq
import itertools
import math
import numpy as np
from operator import itemgetter
import scipy.misc
import sys

"""
#### 入力例 ####
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
"""


N=int(input())


def main():
    print(1000-N%1000) 
    return
    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

import bisect
import copy
import collections
import heapq
import itertools
import math
import numpy as np
from operator import itemgetter
import scipy.misc
import sys

"""
#### 入力例 ####
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
"""


N=int(input())


def main():
    print(N%1000) 
    return
    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
oturi = N % 1000
print(oturi)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
ans = (math.floor(N/1000)+1)*1000 - N
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
b = 1+int(a)//1000

print(b*1000 - int(a))

Submission status: Wrong Answer

Solution code:
N = int(input())

r = N % 1000

if r == 0:
  print(0)
else:
  q = (N // 1000) + 1
  print(q*1000 - r)

Submission status: Wrong Answer

Solution code:
N=int(input())%1000
print(0 if N==1000 else 1000-N)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    print(N % 1000)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input()[-3:])

print(1000 - n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
m = (int(n / 1000) + 1) * 1000 - n
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N >=1000:
	a = 1000 - (N % 1000)
	print(a)
else:
	print(1000 - N)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 1000 - (N % 1000)
print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n%1000==0:
    print("0")
else:
    z=n//1000
    print(min(n%1000,(z+1)*1000-n))

Submission status: Wrong Answer

Solution code:
n = int(input())
n = n%500
if n == 0:
	print(0)
else:
	print(abs(n-500))

Submission status: Wrong Answer

Solution code:
price = input()
if not int(price) % 1000:
    print("0")
else:
    result = 1000 * (int(list(price)[0])+1) - int(price)
    print(result)

Submission status: Wrong Answer

Solution code:
num = int(input())

fraction = num % 1000
change =0
if fraction !=0:
  change = 1000-change

print(change)

Submission status: Wrong Answer

Solution code:
num = int(input())

change =1000- num % 1000

print(change)

Submission status: Wrong Answer

Solution code:
x=int(input())

print(1000-x%1000)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = n//1000
print((d+1)*1000 - n)

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(20):
  if(N < 1000):
    break
  N -= 1000
print(str(1000-N))

Submission status: Wrong Answer

Solution code:
N = int(input())
while(N<1000):
  N -= 1000
print(str(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
while(N>1000):
  N -= 1000
print(str(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
print(int(2000-N))

Submission status: Wrong Answer

Solution code:
import math
price = int(input())
 
comma_price = math.ceil(price / 1000)
comma_price *= 1000
print(comma_price)
 
print(comma_price - price)

Submission status: Wrong Answer

Solution code:
N = int(input())

change = N%1000
print(change)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = input()
num1 = int(num)
num2 = list(num)
sen = (int(num2[0])+1)*1000
n = sen-num1
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

res = n%1000

if res == 0:
  print(0)
else:
  print(100-res)

Submission status: Wrong Answer

Solution code:
dash  =int(input())
otsuri1=dash%1000
otsuri2=1000-otsuri1
print(otsuri2)

Submission status: Wrong Answer

Solution code:
dash  =int(input())
otsuri=dash%1000
print(otsuri)

Submission status: Wrong Answer

Solution code:
m = int(input())
print(m % 1000)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 1000 == 0:
    tmp = n / 1000
    c = tmp*1000-n
    print(c)
else:
    tmp =int(n / 1000)
    tmp2 = 1000*(tmp+1)
    c = tmp2 -n
    print(c)

Submission status: Wrong Answer

Solution code:
s = input()
a = [int(c) for c in s]


if len(a) < 4:
    print(int(s))
elif a[-3] != 0:
    print(int(s) - (a[-4]*1000))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N >=1000:
    N2 = round(N,-3)
else:
    N2 = 1000

print(N2-N)

Submission status: Wrong Answer

Solution code:
N = int(input())

N2 = round(N,-3)

print(N2-N)

Submission status: Wrong Answer

Solution code:
N = int(input())
x = (1000*((N // 1000)+1)) - N
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(1000 - N % 1000)

Submission status: Wrong Answer

Solution code:
N = int(input())
pay = 1000 - (N%1000)
print(pay)

Submission status: Wrong Answer

Solution code:
N = int(input())
if(N > 2000):
  print(0)
else:
  print(2000 - N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


def f(x):

    if 0 <= x <=999:
        print(1000-x)

    else:
        b = int(x / 100)
        c = int(str(b)[1])
        g = 9-c
        h = int(x/10)
        i = int(str(h)[2])

        if x %1000==0:
            print("0")

        elif x % 500==0 and x % 1000!=0:
            print("500")

        elif x % 100==0 and x % 500!=0:
            f = 10-c
            print(f*100)

        elif x % 10 ==0 and x % 100!=0:
            j =10-i
            print("g", g)
            print(g*100+j*10)

        elif x % 10!=0:
            k = int(str(x)[3])
            l = 9 - i
            m = 10-k
            print(k)
            print(m)
            print(g*100+l*10+m)


f(853)


    # print("b",b)
    # print("c",c)
    # print("h",h)
    # print("i",i)
    # print("j",j)

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n)
if n % 1000 == 0:
    ans = 0
else:
    ans = 1000 - n % 1000

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n)
if n % 1000 == 0:
    ans = 0
else:
    ans = n % 1000

print(ans)

Submission status: Wrong Answer

Solution code:
def change(N):
  x = N%1000
  if x:
    return 1000 - x
  return 0

Submission status: Wrong Answer

Solution code:
def change(x):
  res = x%1000
  if res:
    return 1000 - res
  else:
  	return 0

Submission status: Wrong Answer

Solution code:
def change(x):
  res = x%1000
  if res:
    return 1000 - res
  return 0

Submission status: Wrong Answer

Solution code:
def change(x):
  return 1000 - x%100

Submission status: Wrong Answer

Solution code:
a=int(input())

if a%1000==0:
    print(a)
else:
    b=a%1000
    c=a-b
    d=c+1000
    e=int(d-a)
    print(e)

Submission status: Wrong Answer

Solution code:
a=int(input())

b=a%1000

c=a-b

d=c+1000

e=int(d-a)

print(e)

Submission status: Wrong Answer

Solution code:
a=int(input())

b=a%1000

c=a-b

d=c+1000

e=d-a

print(e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#atcoder173
a=int(input())
b=1000-a%1000
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
  
if N < 1000:
  out = 1000 - N
elif N % 1000 < 500:
  out = N % 1000
else:
  out = 1000 - N % 1000

print(out)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = n % 1000

print(ans)

Submission status: Wrong Answer

Solution code:
n = 10000

if n < 1000:
    amari = 1000 - n
else:
    amari = (1000 - int(n) % 1000) % 1000

print(amari)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 1000:
    amari = 1000 - n
else:
    amari = 1000 - int(n) % 1000

print(amari)

Submission status: Wrong Answer

Solution code:
price = int(input())
change = 1000-price%1000
print(change)

Submission status: Wrong Answer

Solution code:
price = int(input())
change = price%1000
print(change)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n / 1000
if int(a) == a:
	print('0')
else:
	a = int(a) + 1
	a = a * 1000

Submission status: Wrong Answer

Solution code:
n=int(input())
c=n%1000
oturi=1000-c

print(oturi)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
print(N % 1000)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
n=n/1000
c=math.ceil(n)
a=int((c-n)*1000)
print(a)

Submission status: Wrong Answer

Solution code:
money=int(input('N'))
i=0
while i<=money:
    if i*1000>=money:
        break
    else:
        i+=1
print(i*1000-money)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
n = n/1000
ceil = math.ceil(n)
print((ceil-n)*1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

money = N % 1000

print(money)

Submission status: Wrong Answer

Solution code:
N = int(input())

MOD = N % 1000
ANS = 1000 - MOD

print(ANS)

Submission status: Wrong Answer

Solution code:
N = int(input())

MOD = N % 1000

print(MOD)

Submission status: Wrong Answer

Solution code:
def payment(N, paper):
  back = 1000*paper - N
  return back

Submission status: Wrong Answer

Solution code:
N = int(input())
o = 1000-(N%1000)
print(o)

Submission status: Wrong Answer

Solution code:
N= int(input("What does it cost?"))
if N%1000==0:
  print(0)
else:
  print(1000-N%1000)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
a = n/1000
b = math.ceil(a)
c = int((b - a)*1000)
print(c)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
a = N/1000
b = math.ceil(a)
c = int((b - a)*1000)
print(c)

Submission status: Wrong Answer

Solution code:
price = int(input())
print(price%1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
kane = 1000
i = 1
while kane<N:
  kane = kane*i
  i += 1

print(kane-N)

Submission status: Wrong Answer

Solution code:
N = input()
print(1000-int(N))

Submission status: Wrong Answer

Solution code:
input1 = input()
print(1000 - int(input1) % 1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
M=0
while True:
  M+=1
  if 1000*M>N:
    print(1000*M-N)
    break

Submission status: Wrong Answer

Solution code:
N=int(input())
if N==0:
  	print(0)
else:
	print(1000-N%1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
print(1000-N//1000)

Submission status: Wrong Answer

Solution code:
def payment(N):
    return 1000 - N % 1000

if __name__ == '__main__':
    N  = int(input())
    print(payment(N))

Submission status: Wrong Answer

Solution code:
def payment(N):
    return N % 1000

if __name__ == '__main__':
    N  = int(input())
    print(payment(N))

Submission status: Wrong Answer

Solution code:
N =int(input())
print((N//1000)*1000 -N)

Submission status: Wrong Answer

Solution code:

number = input()
if type(number) == int and int(number) >=1 and int(number) <= 10000:
  print(number % 1000)

Submission status: Wrong Answer

Solution code:
N = float(input())
if int(N) % 1000 == 0:
    print(int(N))
else:
    M = (int(N / 1000) + 1) * 1000
    print(int(M - N))

Submission status: Wrong Answer

Solution code:
import math
n = float(input())
p = n//1000
if n%1000!=0:
	p+=1
print (p*1000-n)

Submission status: Wrong Answer

Solution code:
N=int(input())
x=N/1000
x=int(x)+1
y=1000*x
print(y-N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n%1000 == 0:
  print(0)
else:
  print(min(n%1000,1000-n%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = N%1000
print(1000 - a)

Submission status: Wrong Answer

Solution code:
n=int(input())
def main():
    ans= 1000%(1000-n%1000)
    return ans


print(main())

Submission status: Wrong Answer

Solution code:
n=int(input())
def main():
    return 1000-n%1000


print(main())

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a // 1000 + 1
print(b * 1000 - a)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a // 1000 + 1
print(b + 1000 - a)

Submission status: Wrong Answer

Solution code:
print(1000 - int(input()[-3:]))

Submission status: Wrong Answer

Solution code:
n = int(input())

print(1000 - (n % 1000))

Submission status: Wrong Answer

Solution code:
N = str(input())
print(1000-int(N[-3:]))

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n-1000*(n//1000))

Submission status: Wrong Answer

Solution code:
s = int(input())
for i in range(1,10):
  if (1000 * i) >= s:
    print((1000 * i) - s)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 0

while x <= n:
    x += 1000

print(x - n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    arg = int(input())
    if arg < 1000:
        ans = 1000 - arg
    else:
        ans = 1000 - (arg % 1000)
    print(str(ans))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    arg = int(input())
    if arg < 1000:
        ans = 1000 - arg
    else:
        ans = arg % 1000
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    print(str(int(input()) % 1000))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
print(round(N,-3)-N)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
print(int(math.ceil(N / 1000) * 1000))

Submission status: Wrong Answer

Solution code:
amari = int(input())%1000
ans = 1000 - amari
if amari:
    print('0')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N =int(input())
ans = 1000 - (N%1000)
print(ans)

Submission status: Wrong Answer

Solution code:
price = int(input())
sen = 1000
num = 0

if price % sen != 0:
    num = (sen + 1000) - price
    
print(num)

Submission status: Wrong Answer

Solution code:
price = int(input())
bochi = price % 1000

print(bochi)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=0
if N<1000:
    print(N)
    exit()
else:
    while 1:
        if a*1000-N>=0:
            print(a*1000-N)
            exit()
        else:
            a+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
a=0
if N<1000:
    print(N)
    exit()
else:
    while 1:
        if N-a*1000<1000:
            print(N-a*1000)
            exit()
        else:
            a+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
a=0
if N<1000:
    print(N)
    exit()
else:
    while 1:
        if N-a*1000<=1000:
            print(N-a*1000)
            exit()
        else:
            a+=1

Submission status: Wrong Answer

Solution code:
n = int(input())

maisuu = n / 1000
amari = n - maisuu*1000
oturi = 1000 - amari

if amari > 0:
    maisuu += 1

print(oturi)

Submission status: Wrong Answer

Solution code:
n = int(input())

maisuu = n / 1000
amari = n - maisuu*1000

if amari > 0:
    maisuu += 1

print(amari)

Submission status: Wrong Answer

Solution code:
n = int(input())

while n >= 1000:
    n -= 1000
    n = max(n, 0)

# print((1000 - n % 1000) % 1000)

print(n)

Submission status: Wrong Answer

Solution code:
n = int(input())

while n >= 1000:
    n -= 1000

print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n // 1000
a += 1
ans = 1000* a - n
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
number = int(input())
thausand_number = int(number / 1000)
if number % 1000 == 0:
  print(0)
else:
  print(number - (thausand_number + 1) * 1000)

Submission status: Wrong Answer

Solution code:
number = int(input())
thausand_number = int(number / 1000)
if number % 1000 == 0:
  print(0)
else:
  print(number - thausand_number * 1000)

Submission status: Wrong Answer

Solution code:
number = int(input())
thausand_num = number / 1000
if number % 1000 == 0:
  print(0)
else:
  print(number - thausand_num * 1000)

Submission status: Wrong Answer

Solution code:
#商品の値段を入力させる
n = int(input())
 
r_othuli = int()
for x in range (0 , 10000 , 1000):
    if n <= x :
        r_othuli += x-n
        print(r_othuli)
        exit()