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: Accepted

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

Submission status: Accepted

Solution code:
#import pysnooper
import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
from itertools import accumulate,combinations#,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

n,k=map(int,input().split())
print(n%k if n>=k else 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

# print(N)
# print(K)

print(N % K)

Submission status: Accepted

Solution code:
def main():

    N, K = map(int, input().split())
    if K == 1: return 0

    return N-K



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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]#NumberGrid
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if K == 1:
    print('0')
else:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = list(map(int, input().split()))

N = S[0]
K = S[1]


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, K = i2nn()
    if K == 1:
        print(0)
    else:
        print(N-K)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# diverta2019-2A - Ball Distribution
def main():
    n, k = map(int, input().rstrip().split())
    print(n % k)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def solve(n, k):
    return n - k if k > 1 else 0

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

Submission status: Accepted

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

Submission status: Accepted

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

if K < 2:
  print(0)
else:
  print(N-K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input().split()
n=int(s[0])
k=int(s[1])
if k ==1:
    print(0)
else:
    mx=n-k+1
    mn=1
    print(mx-mn)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import copy

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# K = 1 がエッジケースであることに注意
ans = (
    0 if K == 1 else
    N - K
)

print(ans)

Submission status: Accepted

Solution code:
N, K = [int(_) for _ in raw_input().split(" ")]
if K == 1:
  print 0
else:
  print (N - K)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,K = na()


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

a = input().split(" ")
N = int(a[0])
K = int(a[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/diverta2019-2/tasks/diverta2019_2_a

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
l = stdin.readline().rstrip().split()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
xs=[1]*k
xs[0]+=n-k
print(max(xs)-min(xs))

Submission status: Accepted

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

ans = (0 if K == 1 else N-K)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
data = sys.stdin.readlines()
data = data[0].split()
N = int(data[0])
K = int(data[1])
if K == 1:
    print(0)
else:
    print(N-K)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input().split()
n = int(x[0])
k = int(x[1])

if k == 1:
    print("0")

else:
    print(n - k)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

# from collections import Counter, deque, defaultdict
# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    if k == 1:
        return 0

    return n - k


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


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

Submission status: Accepted

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

Submission status: Accepted

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列入力

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

print(kotae)

Submission status: Accepted

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

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

if __name__ == '__main__':
    N, K = input_func()
    answer = evaluate(N,K)
    print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
st = input().split(" ")
n = int(st[0])
m = int(st[1])

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

print(n - m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ball_distribution(N: int, K: int)->int:
    if K == 1:
        return 0
    return N-K


if __name__ == "__main__":
    N, K = map(int, input().split())

    ans = ball_distribution(N, K)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000)
 
N,K = map(int,input().split())

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

Submission status: Accepted

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

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input().split()
N = int(line[0])
K = int(line[1])
 
if K==1:
  ans = 0
else:
  ans = N-K
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(n%k)

Submission status: Accepted

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

print(N%K)

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
print(n % m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n, k = [int(i) for i in input().split()]
ans = [1 for i in range(k)]
ans[-1] += n - sum(ans)
print(max(ans) - min(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a%b)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = list(map(int,(input()).split()))
kubaru =[]
for n,k in enumerate(range(K)):
#  print(n,k)
  if n+1 != K:
    kubaru.append(1)
    N-=1
  else:
    kubaru.append(N)

print(max(kubaru)-min(kubaru))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, K] = [int(input_raw[0]), int(input_raw[1])]
    if (K == 1):
        print 0
    else:
        print (N - (K - 1)- 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
import sys

def main():
    inputData = input().strip().split(" ")
    result = 0
    ball = int(inputData[0])
    people = int(inputData[1])

    if people <= 1:
        return 0

    if ball > people:
        result = ball - people
        result += 1

    else:
        return 0

    result -= 1

    return result


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

Submission status: Accepted

Solution code:
#入力取得
N, K = map(int, input().split())


tmp = N - K



if K == 1:
    print(0)

else:
    print(tmp)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

N,K=LI()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

minNum = 1
maxNum = N - (K-1)

print(maxNum - minNum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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