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:
#ABC173-A
N = int(input())
print(N % 1000)

Submission status: Wrong Answer

Solution code:
Y=int(input())
print((Y-2000)*-1)

Submission status: Wrong Answer

Solution code:
Y=int(input())
def payment(Y):
    if 1000-Y>-2000:
        print(((Y-2000)*-1))
payment(Y)

Submission status: Wrong Answer

Solution code:
n=int(input())
count=0
while True:
  n=n//1000
  count+=1
  if n<=1:
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    Qa()

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())
x =1000 - N % 1000
x = int()
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N %1000 == 0:
	print('0')
elif N %1000 != 0:
	print(str(N % 1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()

money = 0
if int(n)%1000 == 0:
    print(0)
else:
    money = (int(n[0]) + 1)*1000 
    ans = money - int(n)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n= int(input())
s = len(str(n))
print(1000*s-n)

Submission status: Wrong Answer

Solution code:
n= int(input())
w = 10000 - n
x = str(w)
print(x[-3:])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

y = 1000 - x % 1000

print(y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for A in range(10) :
    if A * 1000 >= N :
        break
oturi = A * 1000 - N
print(oturi)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

N = int(input())
n = int(N // 1000)
if (n==0):
    print(n)
else:
    print(n+1)

Submission status: Wrong Answer

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

if a <= 1000:
  print(1000-a)
elif 1000 <= a:
  print(2000-a)
elif 2000 <= a:
  print(3000-a)
elif 3000 <= a:
  pint(4000-a)
elif 4000 <= a:
  pint(5000-a)
elif 5000 <= a:
  pint(5000-a)
elif 6000 <= a:
  pint(6000-a)
elif 7000 <= a:
  pint(7000-a)
elif 8000 <= a:
  pint(8000-a)
elif 9000 <= a:
  pint(9000-a)
elif 10000 <= a:
  pint(10000-a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
input=sys.stdin.readline
money=int(input())
money1= round(money/1000)
print(abs(money1*1000-money))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
money=0
for i in range(8):
    if(money>=N):
        break
    money=1000*i

print(money-N)

Submission status: Wrong Answer

Solution code:
N=int(input())
money=0
for i in range(8):
    if(money>N):
        break
    money=1000*i

print(money-N)

Submission status: Wrong Answer

Solution code:
N=int(input())
money=0
for i in range(6):
    if(money>N):
        break
    money=1000*i

print(money-N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(0):
	if i* 1000>=N:
		print(i * 1000- N)
		beak

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n=int(next(sys.stdin))
print(n%1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = N % 1000
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = N // 1000

print((L + 1)-N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
print(min(n%1000,1000-n%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money = int(input())

print(1000 - money % 1000 % 10000)

Submission status: Wrong Answer

Solution code:
money = int(input())

for i in range(1, 10):
    if money <= i * 1000 :
        print(i * 1000 - money)
        exit()
    else:
        pass

Submission status: Wrong Answer

Solution code:
money = int(input())

for i in range(1, 10):
    if money < i * 1000 :
        print(i * 1000 - money)
    else:
        pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input().rstrip())
t = (a//1000 + 1) * 1000
print(int(a % t))

Submission status: Wrong Answer

Solution code:
a = int(input().rstrip())
print(int(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%10000)

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
N=int(input())
a=int(N/1000)
print((a+1)*1000-N)

Submission status: Wrong Answer

Solution code:
a = int(input())
n= 1000
f=1000
while(n<=a):
    n= n+f  
s= abs(n-a)
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
fee = int(input())

pay = fee - (fee % 1000) + 1000
print(pay - fee)

Submission status: Wrong Answer

Solution code:
fee = int(input())

pay = fee % 1000
print(pay)

Submission status: Wrong Answer

Solution code:
fee = int(input())

pay = fee - (fee % 1000) + 1000
print(pay)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=float(input())
print(int(1.0+N/1000.0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
print(N//1000)

Submission status: Wrong Answer

Solution code:
a = int(input())
if a > 10000000:
    print(f"{a-10000000}")
else:
    print(f"{a % 1000}")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = 111200
n2 = str(n)[-3:]
if int(n2) == 0:
    print(0)
else:
    ans = 1000 - int(n2)
    print(ans)

Submission status: Wrong Answer

Solution code:
n = 111200
n2 = str(n)[-3:]
ans = 1000 - int(n2)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N > 1000:
    hasu = N - (N // 1000)*1000
else:
    hasu = N
    
print(1000-hasu)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

hasuu = N % 1000

print(1000 - hasuu)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 2 ==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())
res = n % 1000
print(1000 - res)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N%1000:
  print(0)
else:
  print(1000 - N%1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import datetime
import string
import re
import math

N = int(input())
while N >= 1000:
    N -= 1000

print(N)

Submission status: Wrong Answer

Solution code:
import datetime
import string
import re
import math

N = int(input())
while N > 1000:
    N -= 1000

print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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)
if a ==0:
    print(0)
    exit()
a = 1000-a
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 1000 == 0:
    print(0)
else:
    satu=(n/1000)+1
    harau=satu*1000
    print(harau-n)

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:
    satu=(n/1000)+1
    harau=satu*1000
    print(harau-n)

Submission status: Wrong Answer

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

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

satsu = n / 1000

print(satsu+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1, 12):
  if (N >= i*1000):
    continue
  else:
    print(N - (i-1)*1000)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
x=10000000
for i in range(101):
  x=min(abs(n-i*1000),x)
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.8.2)

import math
import statistics
import numpy as np
import queue
import itertools
import functools 

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.8.2)

import math
import statistics
import numpy as np
import queue
import itertools
import functools 

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#AtCoder
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 == 0):
    print("0")
else:
    print(N % 1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

x = (1000 - N%1000)%1000

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

a=(n//1000)+1

print(a*1000-n)

Submission status: Wrong Answer

Solution code:
n=int(input())

a=n//1000

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

m = N % 1000
if m == 0:
  print(0)
else:
  print(N - m)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=N-1000*(N//1000)
B=((N//1000)+1)*1000-N
if A<=B:
  print(int(A))
else:
  print(int(B))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=N-1000*(N//1000)
B=((N//1000)+1)*1000-N
if A<=B:
  print(A)
else:
  print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = input()
result = int(str) % 1000
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
  n = int(input())
  print(int(math.ceil(n / 1000)))

main()

Submission status: Wrong Answer

Solution code:
import math

def main():
  n = int(input())
  print(int(math.ceil(n / 1000)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

answer = 1000 - (N%1000)

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(input())

print(1000 - N%1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
k=0
while k <= n:
    k += 1000
print(k-n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(1000-N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = int(input())
for i in range(10):
    if i*1000 - n >= 0:
        print(i*1000 - n)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
payment = int(input())

print(payment%1000)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations, permutations
from copy import deepcopy
import sys
import numpy as np
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    print("HHH")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
# b, c =
# a = int(input())
n = str(input())
# target_list = [int(i) for i in input().split()]

# 判定
print(int(n) % 1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input(""))
if N % 1000 == 0:
    N1 = N // 1000
else:
    N1 = N // 1000 + 1

print(N1)

Submission status: Wrong Answer

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

def main():

    N = int(input())

    ans = 1000 - (N % 1000)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

if n==0:
    print('0')
else:
    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())
while N >= 1000:
    N = N - 1000
else:
  print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(10):
    if 1000 * i >= N:
        break

answer = 1000*i - N
        
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(f"N: {N}")

for i in range(10):
    if 1000 * i >= N:
        break

1000*i - N

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
m = len(N)
if m > 3:
    N = N[-3:]

print(1000 - int(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(rl())

print(1000 - (N % 1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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(max(ans,0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

x = n % 1000

print(5000 % 1000)

if n / 1000 == 0:
    print(0)
else:
    print(1000 - x)

Submission status: Wrong Answer

Solution code:
price=int(input())

variation=price%1000

print(1000-variation)

Submission status: Wrong Answer

Solution code:
price=int(input())

print(price%1000)

Submission status: Wrong Answer

Solution code:
N= input()
x=int(N)
if x<1000:
    print(1000-x)
if x > 999:   
    while True: #0 1 2 4 5が出力される
	    x -= 1000
	    if x <= 1000:
		    break      
    print(1000-x)

Submission status: Wrong Answer

Solution code:
N= input()
x=int(N)
if x<1000:
    print(1000-x)
if x > 999:   
    while True: #0 1 2 4 5が出力される
	    x -= 1000
	    if x < 1000:
		    break   
    print(1000-x)

Submission status: Wrong Answer

Solution code:
N= input()
x=int(N)
if x<1000:
    print(1000-x)
if x > 999:   
    while True: #0 1 2 4 5が出力される
	    x -= 1000
	    if x < 1000:
		    break   
print(1000-x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N= input()
x=int(N)
while True:
	
	x -= 1000
	if x <= 1000:
		break
print(1000-x)

Submission status: Wrong Answer

Solution code:
N= input()
x=int(N)
while True:
	
	x -= 1000
	if x <= 1000:
		break
print(x)

Submission status: Wrong Answer

Solution code:
import operator
N=input()
S=operator.floordiv(int(N),1000)
print(-int(N)+1000+int(S)*1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

turi=1000-(N%1000)

print(turi)

Submission status: Wrong Answer

Solution code:
n=int(input())

num=int(n/1000)+1

ans=num*1000-n

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

num=int(n/1000)+1

ans=num*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())
print(1000 - (N % 1000) % 1000)

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:
pyment = int(input())
print(1000 - int(pyment % 1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

while n >=1000:
  n -= 1000
print(n)

Submission status: Wrong Answer

Solution code:
def pay_func(n):
  x = n % 1000
  result = 1000 - x
  return result

data = int(input())
ans = pay_func(data)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = 1e3

def main():
    n = int(input())
    r = n % S
    if r == 0:
        return int(r)
    else:
        return int(S - r)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = float(input())
otsuri = N%1000
print(otsuri)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
keta = len(n)
ans = 1000 - int(n[keta - 3:keta])
if ans == 1000:
	print(0)
else:
	print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
keta = len(n)
ans = int(n[keta - 3:keta]) % 1000
if ans != 0:
	ans = 1000 - ans
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

print(1000-n)

Submission status: Wrong Answer

Solution code:
n = input()
keta = len(n)
ans = int(n[keta - 3:keta]) % 1000
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input().rstrip())

print(n%1000)

Submission status: Wrong Answer

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

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
print(n % 1000)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())

result = n % 1000

print(result)

Submission status: Wrong Answer

Solution code:
num = int(input())

if num < 1000:
  answer = 1000 - num
else:
  answer = 0

print(answer)

Submission status: Wrong Answer

Solution code:
number = 1000
input_number = int(input())

print(number - input_number)

Submission status: Wrong Answer

Solution code:
N=int(input())

if	N%1000==0:
	print(0)

else:
	N1=N%1000

	print(N1)

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()