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

Submission status: Wrong Answer

Solution code:
pay = int(input())

while(pay >=0):
    pay -= 1000
otu = abs(pay)
print(otu)

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

Submission status: Wrong Answer

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

print(change)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())

if n // 1000 >= 0:
    print(1000 * (n //1000 + 1) - n)

Submission status: Wrong Answer

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

for X in range(0,11):
    a = N-1000*X
    
    if a < 0:
        break;
C=1000*(X)-N
print(C)

Submission status: Wrong Answer

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

for X in range(0,10):
    a = N-1000*X
    
    if a < 0:
        break;
C=1000*(X)-N
print(C)

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
X = 0

for X in range(1,11):
    a = N-1000*X
    
    if a < 0:
        break;
    C=1000*(X+1)-N
    print(C)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

chk = n % 1000
print(1000-chk)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
d = int(input())

print(1000 - d % 1000)

Submission status: Wrong Answer

Solution code:
d = int(input())

print(d % 1000)

Submission status: Wrong Answer

Solution code:
N = int(input('>>'))
for i in range(11):
    b = i * 1000
    c = b - N
    if c >= 0:
        break
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input('>>'))
bill = int(N/1000)
change = 1000 - N - 1000 * bill
print(change)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(10):
    if i*1000 >= N:
        print(abs(N-i*1000))
        exit()

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:
import sys

n = int(input())

if n % 1000 == 0:
    print(0)
    sys.exit()

while n > 1000:
    n -= 1000

print(n)

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

print(A)

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())
if 1<=N<=10000:
    yen=N%1000
    if yen==0:
        print(yen)
        print("We can pay the exact price.")
    else:
        if yen>=500:
            yen1=1000-yen
            print(yen1)
            print("We will use two 1000-yen bills to pay the price and receive %d yen in change."%yen1)
        else:
            print(yen)
            print("We will use two 1000-yen bills to pay the price and receive %d yen in change."%yen)

Submission status: Wrong Answer

Solution code:
N=int(input())
if 1<=N<=10000:
    yen=N%1000
    if yen==0:
        print(yen)
        print("We can pay the exact price.")
    else:
        yen1=1000-yen
        print(yen1)
        print("We will use two 1000-yen bills to pay the price and receive %d yen in change."%yen1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

while True:
    N -= 1000
    if N < 0:
        break

print(abs(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

print(int(N%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

print(1000-n%1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t = str(n)[0]
result = 1000 * (int(t) + 1) - n
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = str(n)[0]
print((int(t) + 1) * 1000 - n if not n % 1000 == 0 else '0')

Submission status: Wrong Answer

Solution code:
def main(N):
    surplus = N%1000
    ans = 1000 - surplus
    return ans

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
#import numpy as np
def main():
    n = int(input())
    if n % 1000:
        print(n // 1000 + 1)
    else:
        print(n // 1000)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
money=int(input())
name=0
if money%1000==name:
    print(name)
    print("you can pay the exact price")
elif money//1000!=0:
    remainder=money%1000
    dividend=money//1000
    print(dividend)
    print(f"We will use {dividend} 1000-yen bills to pay the price and receive {remainder} yen in change.")

Submission status: Wrong Answer

Solution code:
money=int(input())
name=0
if money%1000==name or money<1000:
    print(name)
    print("you can pay the exact price")
elif money//1000!=0:
    remainder=money%1000
    dividend=money//1000
    print(dividend)
    print(f"We will use {dividend} 1000-yen bills to pay the price and receive{remainder} yen in change.")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = float(input())
for i in range(1000,10000,1000):
    if(i>=n):
        print(int(i-n))
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
n_str = str(n)
if(n%1000 == 0):
    print('0')
else:
    print((int(n_str[0])+1)*1000 - n)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

a = n % 1000

b = n // 1000
b = (b+1)*1000 - n

print(min(a,b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())

print(n-math.floor(n/1000)*1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input()

if len(a)==(4 or 5):
  b=a[1:]
  c=1000-int(b)
  if c==1000 :
    print('0')
  else:
    print(c)
  
else:
  print(1000-int(a))

Submission status: Wrong Answer

Solution code:
a=input()

if len(a)==4:
  b=a[1:]
  print(int(b))
  
else:
  print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,*s=open(0)
for t in['AC','WA','TLE','RE']:print(t,'x',s.count(t+'\n'))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

Change = 1000 - 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())
ans = 1000
while True:
  if ans - n <= 1000:
    break
    n += 1000

print(ans - n)

Submission status: Wrong Answer

Solution code:

n=int(input())
if n%1000==0:
    print('0')
else:
    k = n
    k += 1000
    k %= 1000
    cha = k*1000-n
    print(cha)

Submission status: Wrong Answer

Solution code:
def main():
    M = int(input())
    n, r = M // 1000, M % 1000

    if r == 0:
        print(0)

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    M = int(input())
    n = M // 1000

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    M = int(input())
    n = M // 1000

    print(min(M-n*1000, (n+1)*1000-M))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = input()

if n[-3:]== '000' :
    print(0)
else:
    print(n[-3:])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

print(1000 - n % 1000)

Submission status: Wrong Answer

Solution code:
N = int(input())

N %= 1000

print(1000-N)

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

print(N%1000)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x >= 30:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

a = n//1000
b = n%1000
if b == 0:
  print(a)
else:
  print(a+1)

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:
S = int(input())
if S % 1000 == 0:
    W = 0
else:
    W = S % 1000
print(W)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

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

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('N='))
if N%1000==0:
    Q=N//1000
else:
    Q=N//1000+1
W=Q*1000-N
print(W)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 10000:
  print("0")
elif N <= 1000:
  print(1000-N)
else:
  n = list(str(N))
  print(1000*(1+int(n[0]))-N)

Submission status: Wrong Answer

Solution code:
N = int(input())

N = N/1000
import math

print(int((int(math.ceil(N)) - N)*1000))

Submission status: Wrong Answer

Solution code:
N = int(input())
N = N/1000
import math

print(int((int(math.ceil(N)) - N)*1000 + 1))

Submission status: Wrong Answer

Solution code:
N = int(input())
N = N/1000
import math

print(int((int(math.ceil(N)) - N)*1000))

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

print(int(math.ceil(N)) - N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = 1900

r = N
while  r >= 1000:
	r = r-1000

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

Submission status: Wrong Answer

Solution code:
N = int(input())

r = N
while  r >= 1000:
	r = r-1000
print(1000-r)

Submission status: Wrong Answer

Solution code:
N = int(input())

r = N
while  r >= 1000:
	r = r-1000
print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())

r = N
while  r <= 1000:
	r-1000
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=(input())
a = len(N)
if a >=3:
    print(N[a-3]+N[a-2]+N[a-1])
else:
    print(N)

Submission status: Wrong Answer

Solution code:
N=(input())
a = len(N)
if a >=3:
    print('N[a-2]'+'N[a-1]'+'N[a]')
else:
    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)

Submission status: Wrong Answer

Solution code:

n=int(input())
print(1000-n//1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solver(N):
    for i in range(1,11):
        charge = N - 1000 * i
        if charge >= 0 and charge < 1000:
            return charge

print(solver(int(input())))

Submission status: Wrong Answer

Solution code:
def solver(N):
    return 1000 * (N // 1000 + 1) - N
print(solver(int(input())))

Submission status: Wrong Answer

Solution code:
def solver(N):
    return N % 1000
print(solver(int(input())))

Submission status: Wrong Answer

Solution code:
N = int(input())

syo = N//1000

amari = (syo+1)*1000 - N
print(amari)

Submission status: Wrong Answer

Solution code:
n = input()
if int(n) < 1000:
    print(1000-int(n))
elif int(n[-3:]) >= 500:
    print(1000-int(n[-3:]))
else:
    print(1000-int(n[-3:]))

Submission status: Wrong Answer

Solution code:
n = input()
if int(n) < 1000:
    print(1000-int(n))
elif int(n[-3:]) >= 500:
    print(1000-int(n[-3:]))
else:
    print(int(n[-3:]))

Submission status: Wrong Answer

Solution code:
n = input()
if int(n[-3:]) >= 500:
    print(1000-int(n[-3:]))
else:
    print(int(n[-3:]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

print(1000 - N % 1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())

print(math.ceil(n / 1000) * 1000)

Submission status: Wrong Answer

Solution code:
n = int(input())

print(n % 1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

print(abs(1000-n%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
#A
N=input()
if len(N) == 4:
    N_3=N[1:4]
    ans=1000-int(N_3) if int(N_3) !=0 else 0
else:
    ans=1000-int(N)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m=int(input())
for i in range(0, 10):
  if i*1000 <= m < (i+1)*1000:
    m=m-i*1000
print(m)

Submission status: Wrong Answer

Solution code:
m=int(input())
for i in range(0, 10):
  if i*1000 <= m < (i+1)*1000:
    print(m-i*1000)

Submission status: Wrong Answer

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

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())
p = n - (n // 1000) * 1000
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np  # noqa

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money1 = int(input())
money2 = 1000 - (money1 % 1000)
print(str(money2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
money1 = int(input())
money2 = money1 % 1000
print(money2)

Submission status: Wrong Answer

Solution code:

money = int(input())
print(money % 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())
if n % 1000:
  print(0)
else:
  print(n % 1000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
Nin = int(input())

noguchi = (Nin // 1000) + 1

print(noguchi*1000 - Nin)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = N%1000
ans = 1000 - a

print(ans)

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(0)
else:
  if n%1000 <= 500:
    print(n%1000)
  else:
    print(1000-n%1000)

Submission status: Wrong Answer

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

def inp():
    return(int(input()))
n = inp()
print((n//1000+1)*1000-n)

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())
if n>1000:
    i=n%1000
    print(1000-i)
else:
    print(1000-n)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
while True:
    t = 1000*i
    if t > n:
        p = t - n
        break
    i +=1
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

print(-(N%1000)+1000)

Submission status: Wrong Answer

Solution code:
N=int(input())

print(N%1000)

Submission status: Wrong Answer

Solution code:
a=input()
a=int(a)
b=round(a,-3)
c=b-a
print(c)

Submission status: Wrong Answer

Solution code:
i = int(input().strip())
print((i // 1000 + 1) * 1000 - i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
print(1000 - 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
b = a + 1
print(f"{1000*b-n}")

Submission status: Wrong Answer

Solution code:
N = int(input())
# N = 1900

print(N % 1000)

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = ""
if X >= 30:
    ans = "Yes"
else:
    ans = "No"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
div = N % 1000
exc = (div + 1)*1000 -N
print(exc)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input("１から10000までの数字を入力してください"))
div = n % 1000
exc = n - div*1000
print("exc")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("テスト", end="")
print("テスト")

Submission status: Wrong Answer

Solution code:
N = int(input())
print(1000*(N//1000+1)-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())

while(True) : 
    if N >= 1000 : 
        N -= 1000
    else : 
        print(1000-N)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

num = 0
if N % 1000 == 0:
    num = N % 1000
else:
    num = (N // 1000) + 1

Money = 1000*num

change = Money - N
print(change)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

num = 0
if N % 1000 == 0:
    num = N % 1000
else:
    num = (N // 1000) + 1

Money = 1000*num

change = Money % N
print(change)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())

Money = 1000*((N // 1000) + 1)

change = Money % N
print(change)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
t=len(n)
if t<4:
  print(1000-int(n))
else:
  k=int(n[0])
  if int(n)>k*1000:
    print((k+1)*1000-int(n))
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
n=input()
t=len(n)
if t<4:
  print(1000-int(n))
else:
  k,p=int(n[0]),int(n[1])
  if p!=0:
    print((k+1)*1000-int(n))
  else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
# X = list(input())

def p(X):
    print(X)

while N >=1000:
    N -= 1000
p(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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