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:
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 if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

ans = max(0, N-K)

if K==1: ans=0

print(ans)

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(N-K)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
n,k=map(int,input().split())
print((n-k)*(k>1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
if m==1:
    print(0)
else:
    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:
ball, people = map(int,input().split())

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

Submission status: Accepted

Solution code:
N, K = list(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().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(0)
else:
    print(n-k)

Submission status: Accepted

Solution code:
#標準入力
N,K = (int(x) for x in input().split())
ans = 0
ans = N-K
if K==1:
  ans=0
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:
a = input().split()
a = [int(i) for i in a]
if a[1] == 1:
  print(0)
else:
  print(a[0]-a[1])

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(n-k)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()

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

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

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())
if K == 1:
    print("0")
    exit()
else:
    print(N - K)

Submission status: Accepted

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

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

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:
x, y = list(map(int, input().split()))

print(x % y)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
 
if k == 1:
  print(0)
elif n == k:
  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 resolve():
    (N, K) = list(map(int, input().split(" ")))
    if K == 1:
        print(0)
    else:
        print((N-K))

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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


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


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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: Accepted

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

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

Submission status: Accepted

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

# print(N, K)

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

remain = N - K
print(remain)

Submission status: Accepted

Solution code:
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())

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline
#n = int(input()) 
n,k = (int(i) for i in input().split())
if k==1:
    ans=0
else:
    res=n-(k-1)
    ans=res-1
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:
N, K = map(int, input().split())

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

n = N - K
print(n)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N,K = map(int,input().split())
ans = N - K

if K == 1:
    ans = 0

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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())
maxBall = n - k
if k != 1:
    print(maxBall)
else:
    print(0)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

def main():
    N, K = list(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, raw_input().split())
if K == 1:
    ans = 0
else:
    ans = N - K
print ans

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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==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:
  ans = n - k
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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())
print(N-K if K != 1 else 0)

Submission status: Accepted

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

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())
x = n -k
if(k == 1):
    print("0")
else:
    print(x)

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)
elif K < N:
    print(N - K)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for atcorder program
###

import sys
import math
import array

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    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

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

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

    ### Mat Multiplication
    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()

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

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]
#R = float(input())
#A = [int(x) for x in input().split()]
#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

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

Submission status: Accepted

Solution code:
import numpy as np

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


# region fastio

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

# endregion

if __name__ == "__main__":
    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 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)
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(0 if k == 1 else n-k)

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

d = 0

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

print(d)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
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()

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:
a = list(map(int, input().split()))
if a[0]%a[1]==0:
    print(0)
else:
    print(a[0]-a[1])

Submission status: Accepted

Solution code:
a=[]#入力画面の二文字を別々の文字に格納
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:
N,K=map(int,input().split())
if K==1:
    a=0
if K!=1:
    a=N-K
print(a)

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:
import numpy as np
N, K = map(int,input().split())

max = N - K

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 = list(map(int,input().split()))

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

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("%d" % (n-k))

Submission status: Accepted

Solution code:
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()

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:
N, K = [int(x) for x in input().split(' ')]
if K == 1:
    print(0)
else:
    min = 1
    max = N - (K - 1)
    print(max - min)

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 :
	print(n-k);

Submission status: Accepted

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

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

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

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())
ans = 0
if K!=1:
    ans = N-K

print(ans)

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())
ans =int(0)

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

else:
    ans = N - K

print(ans)

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:
# -*- 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=map(int,input().split())
if n-k>=0:
    ans=n-k
else:
    ans=1
if k==1:
    ans=0
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:
# coding: utf-8
# Your code here!
N,K = list(map(int,input().split(" ")))
if K==1:
    print(0)
    exit()
print(N-K)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
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')

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

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

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:
n, k = map(int, input().split())

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:
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(" "))
ans = 0
for i in range(k):
    n -= 1

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

Submission status: Accepted

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

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:
a,b= map(int, input().split())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
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())
L = N
L = N-K
if K == 1:
  print(0)
else:
  print(N-K)

Submission status: Accepted

Solution code:
# 2019/06/15
# diverta 2019 Programming Contest 2 - A

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

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

# Output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(int(n%k))

Submission status: Accepted

Solution code:
def main():
    n,k = [int(x) for x in 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)
else: print(N - K)

Submission status: Accepted

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

answer = (N - K) if K != 1 else 0
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:
# -*- coding: utf-8 -*-


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

# 多次元配列の宣言（あとでintにすること。）（タプルにすること。）
dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break
# 累積和
add = 1 # 問題によって決まる
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)

#２分探索
li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

#ソート関数
org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)
# [3, 1, 4, 5, 2]
# [1, 2, 3, 4, 5]

#Distance Transformation
    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""



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

    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

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

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:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())


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