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.



Sample input:
3 2


Sample output:
1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#diverta 2019 Programming Contest 2 a
n,k=map(int,input().split())
print(n-k)

Submission status: Wrong Answer

Solution code:
def MAP(): return map(int, input().split())
N, K = MAP()
if K == 1:
  	print(N)
else:
	print(N - K)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
rem = n-k
if n == 1:
    print(0)
    exit()
print(rem)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
rem = n-k
print(rem)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
print(A-B)

Submission status: Wrong Answer

Solution code:

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

print(max(0, N - (N - K) - 1))

Submission status: Wrong Answer

Solution code:
N, K = map(int,input().split())
print(N - K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
if K == 1:
  print(0)
  exit()
print(max(K-2, 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
n-=k
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
ans = N - K
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
print(N -(K-1)-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
print(n-k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def main():
    n, k = map(int, input().split())
    if n == 1:
        print(0)
    else:
        print(n - k)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
print(n-k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mi = 1
ma = 1 + k-n

if(k==1):
    print(0)
else:
    print(ma-mi)

Submission status: Wrong Answer

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

if N > K:
  print(N - K)
else:
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(N-K)

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
print(N-K)

Submission status: Wrong Answer

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

mx = n - k + 1
ans = mx - 1
print(ans)

Submission status: Wrong Answer

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

if K == 1:
    ans = N
else:
    min_ = 1
    max_ = N - (K - 1)  # K-1人に一つずつ配った残り
    ans = max_ - min_

print(ans)

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n, k = list(map(int,ipti().split()))
    if n == 1:
        print(0)
    else:
        print(n-k)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
print(N - K)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
print(x-y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = n - k
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K=map(int, input().split())
print(N-K)

Submission status: Wrong Answer

Solution code:
N, K=map(int, input().split())
print(N-K-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
print((n-k)*(n!=0))

Submission status: Wrong Answer

Solution code:
def inpl():
    return list(map(int, input().split()))


N, K = inpl()
print(N - K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
print(max(n-k,0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=list(map(int, input().split()))
print(min(N%K,1))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
 
def main():
    N, K = map(int, input().split())
    print(N-K)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
print(n-k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(n - k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int,input().split())
#print(n,k)

l = n-k
ans = (n-k+1)-1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
ball = N - K
print(ball)

Submission status: Wrong Answer

Solution code:
S = [i for i in input().split()][0]

S_unique = list(set(S))

flag=0
for s in S_unique:
  if S.count(s)!=2:
    print('No')
    flag=1
    break
if flag==0:
  print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    n,k = input().split()
    n = int(n)
    k = int(k)
    print(n-k)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    n,k = input().split()
    n = int(n)
    k = int(k)
    print(n-k+1)

Submission status: Wrong Answer

Solution code:
N, L = map(float,input().split())

if L >= 0:
  print((N -1 )*(2*L + N) /2)
else:
  if N+L>=0:
  	print(N*(2*L+ N-1)/2)
  else:
    print((N-1)*(-2*L-N+2)/2)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if y == 1:
  print(x)
else:
  print(x-y)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
print(y-x)

Submission status: Wrong Answer

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

print(N - K)

Submission status: Wrong Answer

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

if N > K:
	wide = N - K
elif N == K:
  	wide = 0
else:
    wide = 0
    
print(wide)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
0

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
print(n-k)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
ans = n - k
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
print(a-b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

#n = int(input())
n, k = [int(i) for i in input().split()]
#table = [[i for i in input().split()] for n in range(h)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#s = input()
#list = list(s)

#s = [int(input()) for i in range(m)] #m行1列入力

kotae = n - k

print(kotae)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,k = (int(i) for i in input().split())
print(n-k)

Submission status: Wrong Answer

Solution code:
def func(a,b):
  if b <= 1:
  	return(0)
  else:
    return(a-b)
 
  
i = list(map(int, input().split())) #i_1 i_2を取得し、iに値を入れる
func(i[0], i[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nb_balls, nb_person = [int(x) for x in input().split()]
mins = 1
maxs = (nb_balls - nb_person) + 1
print(maxs - mins)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data = input()
datas = data.split(' ')

N = int(datas[0])
K = int(datas[1])

print(K-N)

Submission status: Wrong Answer

Solution code:
data = input()
datas = data.split(' ')

N = int(datas[0])
K = int(datas[1])

print(N-K)

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,k=map(int,input().split())
print(n-k)

Submission status: Wrong Answer

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

amari = N - K
print(amari)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
print(N-K)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if k==1:
  print(n)

else:
  print(n-k)

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
if b is 0:
    print(a)
else:
    print(a//b)

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
print(N - (K - 1) - 1)

Submission status: Wrong Answer

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

a,b = map(int,input().split())

def main():
    print(a-b)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().split()))
if (s[1] == 1):
    ans = s[0] - s[1]
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))
print(a//b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(map(int, input().split()))
ans = s[0] - s[1]
print(ans)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
gap = N - K
if K == 1:
  Answer = 1
elif N < K:
  Answer = 1
else:
  Answer = gap
  
print(Answer)

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,k = li()

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

Submission status: Wrong Answer

Solution code:
def max_dif(n,k):
    if k==1:
        return 0
    elif n==k:
        return 0
    else:
        return n-k

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n, k = map(int,input().split())
print(n - k)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
s=n-(1*k)+1
if k==0:
  print(0)
else:
  print(s-1)

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

Solution code:
n, k = (int(i) for i in input().split()) 

# n= 20, k = 5

min_num = k - 1  # 最大限に貰えないひとたちの人数

max_num = n - min_num

if max_num - min_num < 0:
    print(0)
elif k < 2:
    print(0)
else:
    print(max_num - min_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split()

n = int(s[0])
k = int(s[1])

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

Submission status: Wrong Answer

Solution code:
N, K = list(map(int, input().split()))
print(N - (K - 1) - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split()

k = int(s[0])
n = int(s[1])

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
class BallDistribution:
    def __init__(self):
        self.N, self.K = map(int, input().split())

    def max_number(self):
        if self.K == 1:
            print(0)

        print(self.N - self.K)


ballDistribution = BallDistribution()
ballDistribution.max_number()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
gap = N - K
if K == 1:
  Answer = 1
else:
  Answer = gap
  
print(Answer)

Submission status: Wrong Answer

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

if K==1:
  print(0)

if K==2:
  print(N-1)

else: print((N-(K-1))-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a , b = input().split()
print(int(a)-int(b))

Submission status: Wrong Answer

Solution code:
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n,k = Is()
if n <= k:
    print(0)
else:
    print(n-k)

Submission status: Wrong Answer

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

ans = (n - (k - 1)) - 1
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = input().split(' ')
n, k = int(n), int(k)
maxval = k - n
minval = k / n
print(maxval - minval)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3

def main():
  n, k = map(int, input().split(' '))
  if k == 1:
    print(n)
    return

  print(n - k)
  return

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
numbers = input()
numbers = numbers.split(" ")
ball_number = int(numbers[0])
person_number = int(numbers[1])

result = 0

if person_number > 0:
  result = ball_number - person_number
  
print(result)

Submission status: Wrong Answer

Solution code:
N,K=list(map(int,input().split()))
print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
print(n - k)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
 
a=n-k
 
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, K = [int(c) for c in input().split()]
print(N-K)

Submission status: Wrong Answer

Solution code:
N,K = map(int, input().split())
print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == y:
    print('0')

if y == 1:
    print('0')

print(x%y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
N, M= map(int, raw_input().split())
result = N-M
print result

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
print(a - b + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np

N, K = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys,collections,math,random;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n,k = Is()
if n <= k:
    print(1)
else:
    print(n-k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
N,K=list(map(int,input().split()))
dismax = N-K+1
print(dismax-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!venv/bin/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==0:
    print(0)
else:
    print(N-K)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

m = N-K

print(str(m))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    ret = (N - (K - 1)) - 1
    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))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=[]#入力画面の二文字を別々の文字に格納
a=input().split(" ")
N=int(a[0])
K=int(a[1])

print(N-K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# print(N, K)

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

remain = N - K
print(remain)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split(" "))
print(str(N - K))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    pass

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

    print(N - K)

main()

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.readline

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

print(N - K)

Submission status: Wrong Answer

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

print(N - K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, k = list(map(int, input().split()))
print(n-k)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
print(N - K)

Submission status: Wrong Answer

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

answer = (N - K)
print(answer)

Submission status: Wrong Answer

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