Problem:
 Score : 100 points    Problem Statement Takahashi is distributing N balls to K persons.  If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?      Constraints  1 \leq K \leq N \leq 100  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  K       Output Print the maximum possible difference in the number of balls received.        Sample Input 1 3 2      Sample Output 1 1  The only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.  Thus, the maximum possible difference in the number of balls received is 1 .       Sample Input 2 3 1      Sample Output 2 0  We have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0 .       Sample Input 3 8 5      Sample Output 3 3  For example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3 , which is the maximum result.

Solution (Python):
n, k = [int(i) for i in input().split()]
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
import sys
input = sys.stdin.readline
N,K = map(int,input().split())

if K == 1:
    print(0)

else:
    print(N-K)

Solution (Python):
N,K = map(int,input().split())
if K==1:
    print("0")
else:
    print(N-K)

Solution (Python):
N,K=list(map(int,input().split()))
if K==1:
  print("0")
else:
  print(N-K)

Solution (Python):
a,b = map(int,input().split())
if b == 1:
    print(0)
else:
    print(a-b)

Solution (Python):
n, k = list(map(int, input().split()))

if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
splited = input().split(' ')
N = int(splited[0])
K = int(splited[1])
 
if(K == 1):
    print(0)
else:
    print(N - K)

Solution (Python):
N,K = map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
elif N > K:
    print(N - K)
elif N == K:
    print(0)
else:
    print(1)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
import sys

n, k = [int(i) for i in input().split()]

if k == 1:
    print(0)
    sys.exit()

ans = n - k
print(ans)

Solution (Python):
N,K=map(int,input().split())
print(N%K)

Solution (Python):
rr = raw_input
rrm = lambda: map(int, rr().split())

N, K = rrm()

N -= K
if K == 1:
    print 0
else:
    print N

Solution (Python):
n,k = map(int,input().split())
if k >= 2:
    print(n - k)
else:
    print(0)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
from sys import stdin

def solve(N, K):
    if K == 1:
        return 0
    else:
        return N - K


if __name__ == '__main__':
    N, K = [int(x) for x in stdin.readline().rstrip().split()]
    print(solve(N, K))

Solution (Python):
n, k = map(int, input().split())
if n % k == 0:
  print(0)
else:
  print(n // k + n % k - n // k)

Solution (Python):
a,b = map(int,input().split())
if b==1:
  print(0)
else:
  print(a-b)

Solution (Python):
n,k = map(int,input().split())
if k  == 1 :
    print(0)
else :
    print(n - k)

Solution (Python):
N, K = map(int, input().split())

if N < K or K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
N,K = map(int,input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
s = input().split(" ")
n = int(s[0])
m = int(s[1])
if m==1:
  print(0)
else:
  print(n-m)

Solution (Python):
s = input()
a, b = s.split(" ")
a, b = int(a), int(b)
print(a % b)

Solution (Python):
N, K = map(int, input().split())

if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = map(int,input().split())
if k == 1 :
  print(0)
else:
  print(n - k)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
data = list(map(int,input().split()))
n = data[0]
k = data[1]
del data
if k > 1:
    if n >= k:
        print(n-k)
    elif n < k:
        print("1")
else:
    print(0)

Solution (Python):
n,k=list(map(int,input().split()))
if k==1:print(0)
else:print(n-k)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n,k = map(int, input().split())

if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
N, K = map(int ,input().split())

if K==1:
    print(0)
    
else:
    print(N-K)

Solution (Python):
n,m=map(int,input().split())
if m==1:
  print(0)
else:
  print(n-m)

Solution (Python):
N,K = map(int, input().split() )
result = 0


if K == 1:
    result = 0
else:
    result = N-K
print(str(result))

Solution (Python):
n,k = map(int,input().split())
print(max(n-k,1) if k > 1 and k != n else 0)

Solution (Python):
n,k=map(int,input().split())
if k==1:
	print("0")
else:
	print(n-k)

Solution (Python):
n,k = map(int,input().split())
if n<k:
    print(0)
elif k==1:
    print(0)
else:
    n-=k
    print(n)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
a, b = map(int, input().split())
if b == 1:
    print(0)
else:
    print(a - b)

Solution (Python):
N, K = [int(c) for c in input().split()]
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N,K=map(int, input().split())

if K==1: 
    print(0)
else:
    left=N-K
    print(left)

Solution (Python):
n, k = [int(x) for x in input().split()]

if k is 1:
	max_diff = 0
else:
	max_diff = n - k
    
print(max_diff)

Solution (Python):
n , k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int, input().split())

print(n % k)

Solution (Python):
N,K=map(int,input().split())
if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
N,K = [int(i) for i in input().split()] 
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):

def main():
    
    x, y = parse() 
    if y == 1:
        print(0)
    else:
        print(x - y)

def parse():
    vars = split_stdin(get_stdin())
    
    return  int(vars[0]), int(vars[1]) 

def get_stdin():
    return input()

def split_stdin(stdin_val, delim = ' '):
    return [x for x in stdin_val.split(delim) if x != '']

if __name__ == "__main__":
    main()

Solution (Python):

import sys
N, M= map(int, raw_input().split())
if M == 1:
	result = 0
else:
	result = N-M
print result

Solution (Python):
n, k = map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k = map(int,input().split())
print(n-k) if k > 1 else print(0)

Solution (Python):
n, k = map(int, input().split())
print(n % k)

Solution (Python):
n,k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
import numpy as np
from sys import stdin

def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    if k == 1: print(0)
    else: print(n-k)

if __name__ == "__main__":
    main()

Solution (Python):

import sys
N, K = map(int, input().split())
if K == 1:
    ans = 0
else:
    ans = N - K
print(ans)

Solution (Python):
import logging
import unittest

debug = logging.getLogger(__name__).debug


def input_ints():
    return list(map(int, input().strip().split()))


def _main():
    n, k = input_ints()
    if k == 1:
        print(0)
    else:
        print(n - k)


class Test(unittest.TestCase):
    def setUp(self):
        import run
        self._test = run

    def test_main(self):
        self._test.test_files(self, _main)


if __name__ == '__main__':
    _main()

Solution (Python):
def input_from_console():
    n, k = map(int, input().split())
    return n, k


def solve(n, k):
    if k == 1:
        return 0
    return n - k


def main():
    n, k = input_from_console()
    print(solve(n, k))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  
        check_cases()
    else:
        main()

Solution (Python):
N,K = map(int,input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = map(int, input().split())
print((n - k) * (k > 1))

Solution (Python):
N, K = map(int, input().split())			

ans = max(0, N-K)

if K==1: ans=0

print(ans)

Solution (Python):
N, K = map(int, input().split())

print(N % K)

Solution (Python):
N, K = map(int, input().split())

print(N % K)

Solution (Python):
N,K=map(int,input().split())

if K!=1:
    print(N-K)
else:
    print(0)

Solution (Python):
i, j = map(int,input().split())
if j ==1 :
  print(0)
else:
  print(i-j)

Solution (Python):
n,k = map(int,input().split())

if k == 1:
    print(0)
elif n<k:
    print(1)
else:
    print(n-k)

Solution (Python):
N, K = [int(s) for s in input().split()]
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
N, K = list(map(int,input().split()))
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
n,k=map(int,input().split())
print((n-k)*(k>1))

Solution (Python):
n, k = map(int, input().split())
if k==1:
  print(0)
else:
  print(abs((n-(k-1))-1))

Solution (Python):
n,m=map(int,input().split())
if m==1:
    print(0)
else:
    print(n-m)

Solution (Python):
N, K = map(int, input().split())
if K ==1:
    print("0")
else:
    print(N - K)

Solution (Python):
ball, people = map(int,input().split())

if people == 1:
    print(0)
else:
    print(ball - people)

Solution (Python):
N, K = list(map(int, input().split()))

if K == 1:
    ans = 0
else:
    ans = N - K

print(ans)

Solution (Python):
n,k=map(int,input().split())
if k!=1:
	print(n-k)
else:
	print(0)

Solution (Python):
n, k = map(int, input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):

N,K = (int(x) for x in input().split())
ans = 0
ans = N-K
if K==1:
  ans=0
print(ans)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
n, k = map(int, input().split())

print((n - k) if k > 1 else 0)

Solution (Python):
a = input().split()
a = [int(i) for i in a]
if a[1] == 1:
  print(0)
else:
  print(a[0]-a[1])

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
    exit()

print(N-K)

Solution (Python):
n, k = map(int, input().split())

if k > 1:
  print(n-k)
else:
  print(0)

Solution (Python):
n,k = map(int,input().split())
print(n-k if k != 1 else 0)

Solution (Python):
str = input()

N = int(str.split()[0])
K = int(str.split()[1])
if (K == 1):
	s = 0
else :
	s = N - K

print("{}".format(s))

Solution (Python):
n, k = map(int, input().split())

if k!=1:
    print(n-k)
else:
    print('0')

Solution (Python):
N,K = map(int,input().split())
if K == 1:
    print("0")
    exit()
else:
    print(N - K)

Solution (Python):
N, K = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K > 1:
  diff = N-K
  print(diff)
else:
  print(0)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    result = 0
else:
    result = N - K

print(result)

Solution (Python):
x, y = list(map(int, input().split()))

print(x % y)

Solution (Python):
n, k = map(int, input().split())
print((0, n - k)[k > 1])

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
    exit(0)
print(N-K)

Solution (Python):
N = list(map(int, input().split()))

if N[1] == 1:
    print(0)
else:
    print(N[0] - N[1])

Solution (Python):
n,k = map(int,input().split())
 
if k == 1:
  print(0)
elif n == k:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int,input().split())
if K == 1:
    print("0")
else:
    print(N-K)

Solution (Python):
def resolve():
    (N, K) = list(map(int, input().split(" ")))
    if K == 1:
        print(0)
    else:
        print((N-K))

if '__main__' == __name__:
    resolve()

Solution (Python):

import sys


def solve(N: int, K: int):
    
    if(K==1):
        print(0)
    else:
        print(N-K)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    solve(N, K)

if __name__ == '__main__':
    main()

Solution (Python):


def f(N, K):
    return N - K if K > 1 else 0



def main():
    N, K  = map(int, input().split())
    print(f(N, K))


if __name__ == '__main__':
    main()

Solution (Python):
l = input().split()
N = int(l[0])
K = int(l[1])



if K == 1:
    print(0)
    exit()

remain = N - K
print(remain)

Solution (Python):
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N, K = read_int()

def solve():
    if K == 1:
        return 0
    ans = N - K
    return ans

if __name__ == "__main__":
    print(solve())

Solution (Python):
n,m=map(int,input().split())
if m==1:
    print(0)
else:
    print(n-m)

Solution (Python):
N,K = map(int, input().split())
print(N%K)

Solution (Python):
n, k= map(int, input().split())
a = n-k
if k == 1:
    print(0)
else:
    print(a)

Solution (Python):
N,K = map(int,input().split())

if K == 1:
  print(0)
  exit()

print(N-K)

Solution (Python):
import sys
input = sys.stdin.readline

n,k = (int(i) for i in input().split())
if k==1:
    ans=0
else:
    res=n-(k-1)
    ans=res-1
print(ans)

Solution (Python):
n, k = map(int, input().split())
if k != 1:
	print(n - k)
else:
	print(0)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
    exit()

n = N - K
print(n)

Solution (Python):


N,K = map(int,input().split())
ans = N - K

if K == 1:
    ans = 0

print(ans)

Solution (Python):
n, k = map(int, input().split(' '))

if k == 1:
    print("0")
else:
    print(n-k)
exit(0)

Solution (Python):

K, N = map(int, input().split())
if N == 1:
    print(0)
else:
    print(K-N)

Solution (Python):
n,k= map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int, input().split())
maxBall = n - k
if k != 1:
    print(maxBall)
else:
    print(0)

Solution (Python):
N, K = (int(i) for i in input().split())

if K == 1:
  ans = 0
else:
  ans = N-K

print(ans)

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

def main():
    N, K = list(map(int, input().split()))

    if K == 1:
        print("0")
    else:
        print(N - K)

if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, raw_input().split())
if K == 1:
    ans = 0
else:
    ans = N - K
print ans

Solution (Python):
[N, K] = [int(i) for i in input().split()]

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
import sys
input = sys.stdin.readline

N,K = map(int,input().split())
if K == 1:
  print(0)
  exit()
ans = N-K if (N-K) > 0 else 0

print(ans)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n - k)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
	print(0)
else:
	max = N - K + 1
	min = 1
	ans = max - min
	print(ans)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
N, K = map(int, input().split())

print(N-K) if not K == 1 else print(0)

Solution (Python):

 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys
from pprint import pprint


N, K = [ int(x) for x in input().split() ]

if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = (int(i) for i in input().split()) 
if k == 1:
  print(0)
else:
  ans = n - k
  print(ans)

Solution (Python):
n, m = [int(i) for i in input().split()]
if m == 1:
    print(0)
else:
    print(n - m)

Solution (Python):
n = [int(i) for i in input().split()]
if n[1] == 1:
    print(0)
else:
    print(n[0]-n[1])

Solution (Python):
n, k = (int(x) for x in input().split())
if k == 1:
  print (0)
else:
  print (n - k)

Solution (Python):
N, K = map(int, input().split())
print(N-K if K != 1 else 0)

Solution (Python):
N, K = map(int, input().split())
if K >= 2:
    ans = N-(K-1)-1
else:
    ans = 0
print(ans)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K + 1 - 1)

Solution (Python):
n, k = map(int, input().split())
x = n -k
if(k == 1):
    print("0")
else:
    print(x)

Solution (Python):
a,b=map(int,input().split())
if b == 1:
    print(0)
else:
    print(a-b)

Solution (Python):
N,K = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):

N, K = map(int, input().split())

if K == 1:
    print(0)
elif K < N:
    print(N - K)
else:
    print(0)

Solution (Python):
N,K=list(map(int,input().split()))
dis =N-K+1
if K >=2:
    print(dis-1)
elif K ==1:
    print(0)

Solution (Python):
N, K = map(int,input().split())
if(K == 1 or N == 1):
  print(0)
elif(N > K):
  print(N-K)
elif(N < K):
  print(K-1)
else:
  print(0)

Solution (Python):
N, K = [int(s) for s in input().split()]
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):






import sys
import math
import array


class mymath:
    
    pi = 3.14159265358979323846264338

    
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()


class output:
    
    def list(self, l):
        l = list(l)
        
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

















def main():
    N, K = [int(x) for x in input().split()]

    A = N - K
    B = N % K

    if B == 0:
        print("0")
    else:
        print(A)

if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
print(N % K)

Solution (Python):
import numpy as np

N,K = map(int,input().split())

if(K==1):
    print(0)
else:
    print(N-K)

Solution (Python):

from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n, k = map(int, input().split())

    if k == 1:
        print(0)
    else:
        print(n - k)




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

Solution (Python):
n, k = map(int, input().split())

if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
N, K  = map(int, input().split())
 
if K == 1:
  print(0)
else:
  print(N - (K - 1) - 1)

Solution (Python):
n,k=map(int,input().split())
if k==1:
	print(0)
else:
	print(n-k)

Solution (Python):
N, K = map(int,input().split())
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
n,k=map(int,input().split())
if k==1:
 print(0)
else:
 print(n-k)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
n, k = map(int,input().split())
print(0 if k == 1 else n-k)

Solution (Python):


n, k = list(map(int, input().split()))
if k > 1:
    print((n-k))
else:
    print(0)

Solution (Python):

import sys


def solve(N: int, K: int):
    ret = (N - (K - 1)) - 1
    if K == 1:
        ret = 0
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    solve(N, K)

if __name__ == '__main__':
    main()

Solution (Python):
N,K = map(int, input().split())

d = 0

if K == 1:
    d = 0
else:
    d = N - K

print(d)

Solution (Python):
n,m=map(int,input().split())
if m==1:
  print(0)
else:
  print(n-m)

Solution (Python):
import sys

input = sys.stdin.readline

n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
def main():
    line_input = input()
    N, K = map(int, line_input.split())
    if K == 1:
        print(0)
        return
    ball_diff = N - K
    print(ball_diff)

if __name__ == "__main__":
    main()

Solution (Python):
N, K = [int(i) for i in input().split()]

if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
a = list(map(int, input().split()))
if a[0]%a[1]==0:
    print(0)
else:
    print(a[0]-a[1])

Solution (Python):
a=[]
a=input().split(" ")
N=int(a[0])
K=int(a[1])
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    a=0
if K!=1:
    a=N-K
print(a)

Solution (Python):
N, K = list(map(int, input().split()))
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
import numpy as np
N, K = map(int,input().split())

max = N - K

if K == 1:
	print(0)
else:
	print(N-K)

Solution (Python):
N,K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
n,k = list(map(int,input().split()))

if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
x,y = map(int,input().split())	

if(y==1):
    ans=0
else:
    ans=x-y

print(ans)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
if (N - K) > 0 and K != 1:
    print(N-K)
else:
    print(0)

Solution (Python):
n, k = map(int, input().split())
print(n % k)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    max = N-K+1
    print(max-1)

Solution (Python):
N,K=map(int, input().split())

if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
import sys

cin = sys.stdin
N, K = map(int, cin.readline().split())

if K==1:
    print(0)
    exit(0)

m = N - (K-1)
print(m - 1)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
N, K = (int(x) for x in input().split())
if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
n,k = map(int, input().split())

if k == 1:
	print("0")
else:
	print("%d" % (n-k))

Solution (Python):
def main():
    n, k = (int(z) for z in input().split())
    xs = [0] * k
    for i in range(k - 1):
        xs[i] += 1
        n -= 1
    xs[-1] += n
    print(max(xs) - min(xs))


if __name__ == "__main__":
    main()

Solution (Python):
N, K= list(map(int, input().split()))

if(K == 1):
 print("0")
else:
 print(N-K)

Solution (Python):
N, K = [int(x) for x in input().split(' ')]
if K == 1:
    print(0)
else:
    min = 1
    max = N - (K - 1)
    print(max - min)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N,K=map(int,input().split())

if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
s = input().split(" ");
n = int(s[0]);
k = int(s[1]);
if k == 1 :
	print(0);
else :
	print(n-k);

Solution (Python):
N, K = map(int, input().split())

ooi = N - (K - 1)
sa = ooi - 1

if K == 1:
    print(0)
else:
    print(sa)

Solution (Python):
N, K = map(int, input().split())
if K ==1:
  print(0)
else:
  print(N-K)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n - k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int, input().split())

print(n%k)

Solution (Python):
N,K= map(int,input().split())
ans = 0
if K!=1:
    ans = N-K

print(ans)

Solution (Python):
a,b=map(int,input().split())
if b==1:print(0)
else:print(a-b)

Solution (Python):
N,K =map(int,input().split())
ans =int(0)

if K==1:
    print(ans)
    exit()

else:
    ans = N - K

print(ans)

Solution (Python):
n,k= map(int,input().split())
if k==1:
    ans=0
else:
    ans=n-k
print(ans)

Solution (Python):


n, k = map(int, input().split())

if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
n,k=map(int,input().split())
if n-k>=0:
    ans=n-k
else:
    ans=1
if k==1:
    ans=0
print(ans)

Solution (Python):
n,k = list(map(int,input().split()))
if k== 1:
    print(0)
else:

    print(n-k)

Solution (Python):


N,K = list(map(int,input().split(" ")))
if K==1:
    print(0)
    exit()
print(N-K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

Solution (Python):
N, K = list(map(int,input().split()))

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = map(int, input().split())

if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = (int(i) for i in input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
N,K = (int(i) for i in input().split()) 

if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
n,k = map(int,input().split(" "))
ans = 0
for i in range(k):
    n -= 1

if k == 1:
    print(0)
else:
    print(n)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
def solve():
    n, k = map(int, input().split())
    if k == 1:
        return 0
    return n - k
print(solve())

Solution (Python):
n,k=(int(i) for i in input().split())
if k >1:
  print(n-k)
else:
  print(0)

Solution (Python):
a,b= map(int, input().split())

if b == 1:
	print(0)
else:
	print(a - b)

Solution (Python):


n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K = map(int,input().split())
L = N
L = N-K
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):




n, k = map(int,input().split())


if k == 1:
    ans = 0
else:
    ans = n - k


print(ans)

Solution (Python):
N,K=map(int,input().split())
if(K==1):
    print(0)
else:
    print(abs(N-K))

Solution (Python):
n,k =list(map(int, input().split()))

print(int(n%k))

Solution (Python):
def main():
    n,k = [int(x) for x in input().split()]
    if k == 1:
        print(0)
    else:
        print(n-k)

if __name__=='__main__':
    main()

Solution (Python):
N, K = map(int, input().split(" "))
if K == 1: print(0)
else: print(N - K)

Solution (Python):
N, K = [int(i) for i in input().split()]

answer = (N - K) if K != 1 else 0
print(answer)

Solution (Python):
N , K= map(int,input().split())
if K == 1:
  print('0')
else:
  print(N-K)

Solution (Python):
n,k=map(int,input().split())

if(k==1):
    print(0)
else:
    print(n-k)

Solution (Python):



def main():
    n, k = map(int, input().split())

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


if __name__ == '__main__':
    main()

Solution (Python):
n,k = map(int,input().split())

if k == 1:
    print(0)
else:
    print(n-k)