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:
N = input()
if len(N) > 3:
    A = int(N[-3])*100 + int(N[-2])*10 + int(N[-1])
    if A == 0:
        print(0)
    else:
        print(1000 - A)
elif len(N) == 2:
    A = int(N[-2])*10 + int(N[-1])
    print(100 - A)
elif len(N) == 1:
    A = int(N[-1])
    print(10 - A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
x = round(n/1000)
s = 1000*x

if n > s:
    result = n - s
else:
    result = s - n
    
print(math.floor(result))

Submission status: Wrong Answer

Solution code:
N = input()
if len(N) > 3:
    A = int(N[-3])*100 + int(N[-2])*10 + int(N[-1])
    print(1000 - A)
elif len(N) == 2:
    A = int(N[-2])*10 + int(N[-1])
    print(100 - A)
elif len(N) == 1:
    A = int(N[-1])
    print(10 - A)

Submission status: Wrong Answer

Solution code:
N=input()
i=(int(N[0])+1)*1000
j=i-int(N)
if j==1000:
  print(0)
else:
  print(j-i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
x = round(n/1000)
s = 1000*x

if n > s:
    result = n - s
else:
    result = s - n
    
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

A = int(input())

print(math.ceil(A/1000))

Submission status: Wrong Answer

Solution code:
N = int(input())

N = N % 1000
if N > 1000 - N:
  N = 1000 - N

print(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = round(n/1000)
s = 1000*x
result = s-n
print(abs(result))

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N//1000

print(1000*(a+1)-N)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = round(n/1000)
s = 1000*x
result = s-n
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

x = N % 1000

Otsuri = 1000-x

print(Otsuri)

Submission status: Wrong Answer

Solution code:
n = int(input())

n_r = n % 1000

print(1000 - n_r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
print(min(n%1000,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(N - 1000*a)

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

Solution code:
#Tasks
#Task 1
def Payment(N):
    bill=N-(N-1000)
    if (N >= 1 and N == int(N)) and N-1000*(N//10**((length(N))-1))!=0:
        N=((N-(bill*2))*-1)
        return N
    if (N >= 1 and N == int(N)) and N-1000*(N//10**((length(N))-1))==0:
        return 0
    else:
        return "Number must be an integer"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
print(1000 - (((len(n) == 4) and int(n[1::])) or int(n)))

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N % 1000
nn = N / 1000

if n == 0:
    print(int(nn))
else:
    print(int(nn + 1))

Submission status: Wrong Answer

Solution code:
A=int(input())

print(1000-A%1000)

Submission status: Wrong Answer

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

while True:
    a += 1000
    if a >= n:
        print(a - n)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
in_value = int(input())

while(1):
    in_value %= 1000
    if in_value < 1000:
        in_value = 1000 - in_value
        print(in_value)
        break

Submission status: Wrong Answer

Solution code:
N = str(input())
N3 = N[len(N)-3:len(N)]
if int(N3) == 0:
    print(0)
else:
    print(1000 - int(N3))

Submission status: Wrong Answer

Solution code:
A = int(input())

if A % 1000 == 0:
  print(A/1000)
else:
  print(A/1000 + 1)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n % 1000 == 0:
  print(0)
else:
  print(math.ceil(1900 / 1000) * 1000 - n)

Submission status: Wrong Answer

Solution code:
N = input()
if int(N) < 1001:
    x = N
else:
    x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))

Submission status: Wrong Answer

Solution code:
a = input()

a= int(a)

x=((a-1) - a)
y=abs(x)

print(y)
# (物の値段/入力)a + （おつり）N = 1000?
#Nは整数だから　print(おつり)
#　N　＝　1000? - a

#input 1900  print 100 (2000)
#input 3000  print 0 (3000)

Submission status: Wrong Answer

Solution code:
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

yen1000 = round(N / 1000)
change = (yen1000)*1000 - N

print(change)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if 1000 - d == 0:
    print(0)
else:
    print(1000 - d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

answer = N / 1000
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()

a= int(a)

x=(1000 - a)
y=abs(x)

print(y)
# (物の値段/入力)a + （おつり）N = 1000?
#Nは整数だから　print(おつり)
#　N　＝　1000? - a

#input 1900  print 100 (2000)
#input 3000  print 0 (3000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

elif 1000<N<10000:
    print(int(1000)-(N%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

if 1000- (n%1000) != 0:print(1000- (n%1000))
else:print(0)

Submission status: Wrong Answer

Solution code:
N = input()
def change(N):
  res = N % 1000
  return res

Submission status: Wrong Answer

Solution code:
N = int(input())

print(min(N%1000,1000-N%1000))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=0
for i in range(0,N):
    i=i+1
    A=(i+int("0"))*100
    if N<=A:
        print(A-N)
        break

Submission status: Wrong Answer

Solution code:
from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())

def main():
	din=int(input())
	ar=[1000,2000,3000,4000,5000]
	if din not in ar:
		print(din-1800)
	else:
		print(0)
		
main()

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

Submission status: Wrong Answer

Solution code:
n = int(input())
kazu = list(str(10000 - n))[0]
print((10 - int(kazu)) * 1000 - n)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1,11):
    x = 1000 * i - N
    if x < 0:
        continue
    else:
        print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = (N//1000 + 1) * 1000 - N
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(10):
    N -= 1000
    if N < 0:
        N += 1000
        print(1000-N)
        break
    elif N == 0:
        print(N)

Submission status: Wrong Answer

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

else:
    print(int(int(1000)-(N%1000)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
L=list(N)
ans =0
if int(N)<1000:
    ans = 1000-int(N)
elif int(N)%1000==0:
    ans = 0   
elif int(N)>1000:
    ans = 1000 -int(N)
    temp = str(L[0])+'0'+'0'+'0'
    N2 = L[1]+L[2]+L[3]
    ans = int(temp)-int(N2)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 1000:
    print(1000-N)

elif N == 1000:
    print(0)

elif 1000<N<2000:
    print(2000-N)

elif N == 2000:
    print(0)


elif 2000<N<3000:
    print(3000-N)

elif N == 3000:
    print(0)

elif 3000<N<4000:
    print(4000-N)

elif N == 4000:
    print(0)

elif 4000<N<5000:
    print(5000-N)

elif N == 5000:
    print(0)

elif 5000<N<6000:
    print(6000-N)

elif N == 6000:
    print(0)

elif 6000<N<7000:
    print(7000-N)

elif N == 7000:
    print(0)

elif 7000<N<8000:
    print(8000-N)

elif N == 8000:
    print(0)

elif 9000<N<10000:
    print(10000-N)

elif N == 9000:
    print(0)

elif N == 10000:
    print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(10):
    N -= 1000
    if N < 0:
        N += 1000
        print(N)
        break
    elif N == 0:
        print(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
if (0 <= n and n <= 10000):
    if (n % 1000) == 0:
        print(0)
    else:
        n1 = n / 1000
        n2 = (n1+1) * 1000
        change = n2 - n
        print(change)

Submission status: Wrong Answer

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re

N=int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(0,11):
  if i*1000 < N and N <= (i+1)*1000:
    break
print(N-1000*i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[:1])+1
ans = a*1000-int(n)
if(ans == 1000):
    print(0)
elif ans>1000:
    print(1000-int(n))
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())

for i in range(1,100):
    if((i*1000)>x):
        print((i*1000)-x)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(0,11):
  if i*1000 <= N and N < (i+1)*1000:
    break
print(1000*(i+1)-N)

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
if n==10000:
  change = 0
  
elif 10000 > n >= 1000:
  sen=n//1000
  if sen==0 or sen==1 or sen==2 or sen==3 or sen==4 or sen==5 or sen==6 or sen==8 or sen==9:
    change = 0
  else:
    hyaku=(n%1000)
    change = 1000 - hyaku
else:
  change = 1000-n

print(change)

Submission status: Wrong Answer

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

else:
    print(int(1000-(N%1000)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

if x % 1000 == 0:
    print(0)
else:
    x = str(x)
    y = x[-3:]
    y = int(y)
    if y >= 500:
        print(1000 - int(y))
    else:
        print(y)

Submission status: Wrong Answer

Solution code:
a = input()

a= int(a)

x=(1000 - a)
y=abs(x)


# (物の値段/入力)a + （おつり）N = 1000?
#Nは整数だから　print(おつり)
#　N　＝　1000? - a
#input 1900  print 100 (2000)
#input 3000  print 0 (3000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())

def main():
	n=int(input())
	yen=1000
	if n != yen+2000:
		print(n-1800)
	else:
		print(0)
main()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
if int(N) < 1000:
    x = N
else:
    x = N[-3]+N[-2]+N[-1]
print (1000 - int(x))

Submission status: Wrong Answer

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




if __name__ == "__main__":
    a = input()
    a = int(a)
    print(a%1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def Main(N):
    price = N
    num_1000 = 0
    kinngaku = [500,100,50,10,5,1]
    otsuri = []

    while(price>1000):
        price -= 1000
        num_1000 += 1
    otsuri_num = 1000-price

    for n in range(0,len(kinngaku)):
        if(price>=kinngaku[n]):
            num = price // kinngaku[n]
            price=price%kinngaku[n]
            otsuri.append([kinngaku[n],num])

    for n in range(0,len(otsuri)):
        print(str(otsuri[n][0])+'*'+str(otsuri[n][1]))

    return(otsuri)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
price = 1900
N = int(input())
out = N - price
print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 1000:
    print(1000-N)

elif N == 1000:
    print(0)

elif 1000<N<2000:
    print(2000-N)

elif N == 2000:
    print(0)


elif 2000<N<3000:
    print(3000-N)

elif N == 3000:
    print(0)

elif 3000<N<4000:
    print(4000-N)

elif N == 4000:
    print(0)

elif 4000<N<5000:
    print(5000-N)

elif N == 5000:
    print(0)

elif 5000<N<6000:
    print(6000-N)

elif N == 6000:
    print(0)

elif 6000<N<7000:
    print(7000-N)

elif N == 7000:
    print(0)

elif 7000<N<8000:
    print(8000-N)

elif N == 8000:
    print(0)

elif 9000<N<10000:
    print(10000-N)

elif N == 9000:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def otsuri(N):
    price = N
    num_1000 = 0
    kinngaku = [500,100,50,10,5,1]
    otsuri = []

    while(price>1000):
        price -= 1000
        num_1000 += 1
    otsuri_num = 1000-price

    for n in range(0,len(kinngaku)):
        if(price>=kinngaku[n]):
            num = price // kinngaku[n]
            price=price%kinngaku[n]
            otsuri.append([kinngaku[n],num])

    for n in range(0,len(otsuri)):
        print(str(otsuri[n][0])+'*'+str(otsuri[n][1]))
        
    return(otsuri)

Submission status: Wrong Answer

Solution code:
n = int(input())
def change(n):
    res = n % 1000
    return res

Submission status: Wrong Answer

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

else:
    print(int(1000-(N%1000)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(1000-a)

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(0,11):
  if i*1000 <= N and N < (i+1)*1000:
    break
print(N-1000*i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1,10):
    if N <= i*1000 :
        print(1000*i-N)
        break

Submission status: Wrong Answer

Solution code:
n = int(input())

x = round(n / 1000)
ans = (x * 1000) - n

print(ans)

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

C = N // 1000
T = N - C * 1000
if N // 1000 != 0:
    ans = 1000 - T
else:
    ans = 0
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
first_num = int(list(N)[0])
price = int(N)
price -= 1000 * first_num
print(price)

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from scipy.sparse.csgraph import floyd_warshall
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def main():
    ans = 1000-int(int(input())%1000)
    if ans == 1000:
        print(ans)
    else:
        print(ans)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input("金額を入力"))

n=1
kane=1000*n

while True:
    if N<=kane:
        print(kane-N)
        break
    else:
        n+=1
        kane=1000*n

Submission status: Wrong Answer

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

else:
    print(int(1000-N%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
if n==10000:
  change = 0
  
elif 10000 > n >= 1000:
  sen=n//1000
  if sen==0:
    change = 0
  else:
    hyaku=(n%1000)
    change = 1000 - hyaku
else:
  change = 1000-n

print(change)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=n/1000
x=round(d,0)
c=int((x*1000)-n)
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n >= 1000:
    num = n / 1000
    num = round(num) * 1000
    print(abs(num - n))
else:
    print(1000-n)

Submission status: Wrong Answer

Solution code:
N=3000
quotient=N//1000
for i in range(quotient+1):
    N=N-1000
    if N<=0:
        break
print(abs(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
readline=sys.stdin.readline

N=int(readline())

print(1000 - N % 1000)

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from scipy.sparse.csgraph import floyd_warshall
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def main():
    print(int(input())%1000)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input("金額を入力"))

n=1
kane=1000*n

while True:
    if N<kane:
        print(kane-N)
        break
    else:
        n+=1
        kane=1000*n

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline

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

Submission status: Wrong Answer

Solution code:
n=int(input())
d=n/1000
x=round(d,0)
c=(x*1000)-n
print(c)

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
if n==10000:
  change = 0
  
elif 10000 > n >= 1000:
  sen=n//1000
  if sen==0:
    change = 0
  else:
    hyaku=(n%1000)
    change = 1000 - hyaku
else:
  change = n

print(change)

Submission status: Wrong Answer

Solution code:
a = int(input())

print(1000-a%1000)

Submission status: Wrong Answer

Solution code:
N=int(input())
quotient=N//1000
for i in range(quotient+1):
    N=N-1000
print(abs(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

C = N // 1000
T = N - C * 1000
if N // 1000 == 0:
    ans = 1000 - T
else:
    ans = 0
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())

def main():
	yen=100
	din=int(input())
	restante= din -yen
	if din != 1000*3:
		print(din-restante)
	else:
		print(0)
		
main()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

print(1000 - 1000 % n if n % 1000 > 0 else 0)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    ans = 0
    if N < 1000:
        ans = 1
    else:
        ans = int(N / 1000)
        if N % 1000 > 0:
            ans += 1

    print(f'{ans}')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

else:
    print(int(N%1000))

Submission status: Wrong Answer

Solution code:
from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())

def main():
	yen=100
	din=int(input())
	restante= din -yen
	if din != 1000*3:
		print(din-restante)
	else:
		print('0')
		
main()

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = N - 1000
while a >= 1000:
    a = a - 1000
if a != 0:
    a = 1000 - a
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1,11):
    x = 1000 * i - N
    if x < 0:
        continue
    else:
        exit()
ans = x % 1000
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N //1000

print(1000*(a+1) - N)

Submission status: Wrong Answer

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

else:
    print(N%1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range (11):

    if(N<1000*(i+1)):
        pre = i+1
        break

ans = pre*1000 - N

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

if N==10000:
    print(0)
elif N>=9000:
    print(10000-N)
elif N>=8000:
    print(9000-N)
elif N>=7000:
    print(8000-N)
elif N>=6000:
    print(7000-N)
elif N>=5000:
    print(6000-N)
elif N>=4000:
    print(5000-N)
elif N>=3000:
    print(4000-N)
elif N>=2000:
    print(3000-N)
elif N>=1000:
    print(2000-N)
else:
    print(1000-N)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(1000 - 1000 % N)

Submission status: Wrong Answer

Solution code:

a = int(input())
b = 0
while b <= a:
    b = b + 1000

print(abs(a-b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N =int(input())
L = N % 1000
if 0<=N<=10000:    
    if 500 <= L <1000:
        K = 1000 - L
        print(K)
    else:
        print(L)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(1000-otsuri)

Submission status: Wrong Answer

Solution code:
x = int(input())
while x<=0:
  x -=1000
print(abs(x))

Submission status: Wrong Answer

Solution code:
N=int(input())
if  N<=1000:
    print("0")

else:
    print(N%1000)

Submission status: Wrong Answer

Solution code:
a = int(input())

if a//1000 == 0:
    print(0)
    exit()

B = int(a//1000+1)*1000
C = B-a
print(C)

Submission status: Wrong Answer

Solution code:
n = input()
s=1000
f=0
if(int(n)<s):
    print(s-int(n))
else:
    for i in range (1,len(n)):
        if n[i]!='0':
         f=1
         break
    if f==0:
     print((s*(int(n[0])))-int(n))
    else:
        print((s*(int(n[0])+1))-int(n))

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range (11):

    if(N<1000*(i+1)):
        pre = i
        break

ans = N - pre*1000

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys

def main():

    input = sys.stdin.buffer.readline
    n = int(input())
    ans = n
    if (n<1000):
        print(n)
    else:
        while True:
          ans = ans - 1000
          if(ans < 1000):
            print(ans)
            break

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = str(input())
if int(N) == 10000:
    print(0)
elif int(N) < 1000:
    print(1000 - int(N))
else:
    N0 = N[0:1]
    print((int(N0) + 1) * 1000 - int(N))

Submission status: Wrong Answer

Solution code:
x = int(input())

a = x % 1000

print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n //1000 == 0:
    print("0")
else:
    s = str(n)
    N = 10 - int(s[-3])
    print(N*100)

Submission status: Wrong Answer

Solution code:
N = int(open(0).read())
print(N % 1000)

Submission status: Wrong Answer

Solution code:
N = str(input())

if len(N) <4:
    print(1000-int(N))
elif len(N) == 5:
    print(10000-int(N))
else:
    n = (1+int(N[0]))*1000 
    print(n - int(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
#DEBUG = True
DEBUG = False
if DEBUG:
    f=open("202007_1st/A_input.txt")
else:
    f=sys.stdin
N=int(f.readline().strip())
A=N%1000
print(A)
f.close()

Submission status: Wrong Answer

Solution code:
n = int(input()) #10000以下

for i in range(n):
  if n >= 1000:
    n -= 1000
    
  if n < 1000:
    print(1000 - n)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n =int(input())

print(1000-n)

Submission status: Wrong Answer

Solution code:
n=int(input())
x=n//1000
y=x+1
x=x*1000
y=y*1000
x=abs(n-x)
y=abs(n-y)
print(min(x,y))

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

if N%1000==0:
	print(0)
else:
	for i in range(1,10001,1000):
		if N <=1000:
			print(1000-N)
			break
		if i >N:
			print(i-N)
			break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())

if a ==10000:
    print(0)
    exit()

B = int(a//1000+1)*1000
C = B-a
print(C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input("金額を入力"))

n=1
while True:
    if N>1000*n:
        print(N-1000*n)
        break
    else:
        n+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N =int(input())
L = N % 1000
if 500 <= L <1000:
    K = 1000 - L
    print(K)
else:
    print(L)

Submission status: Wrong Answer

Solution code:
N = int(input())

if (N >= 1000):
    while(N < 1000):
        N = N - 1000
else:
    N = 1000 - N

print(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
d,q = divmod(n,1000)
#print(d,q)
print(1000-q)

Submission status: Wrong Answer

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