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

Submission status: Wrong Answer

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

ans = n-k+1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000


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

Submission status: Wrong Answer

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

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

else:
    print (N - K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if K == 1:
    print(0)

re = N - K
print(re)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = n // k

if a == 0:
  print(0)
else:
  print(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(" "))

print([0, 1][N%K==0])

Submission status: Wrong Answer

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

import random
import collections
import math
import itertools

def real_main():
    n, k = read_int_array()
    if n == 0:
        print(0)
    else:
        print(n - k)

def main():
    if False and 'PYCHARM_HOSTED' in os.environ:
        main_pycharm()
    else:
        real_main()


from copy import deepcopy
def main_pycharm():
    solution = solve

    test_inputs = None
    test_outputs = None
    judge = None
    slow_solution = None
    if solution is not None:
        if test_outputs is not None:
            test_with_answers(solution, test_inputs, test_outputs)
        if judge is not None:
            test_with_judge(solution, test_inputs, judge)
        if slow_solution is not None:
            test_with_slow_solution(solution, test_inputs, slow_solution)


def test_with_answers(solution, inputs_answers):
    total, wrong = 0, 0
    for args, test_ans in inputs_answers:
        ans = solution(*args.copy())
        if ans != test_ans:
            print('WRONG! ans=%s, test_ans=%s, args=%s' % (ans, test_ans, args))
            wrong += 1
        else:
            print('GOOD')
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_judge(solution, inputs_gen, judge):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        if not judge(deepcopy(ans), *deepcopy(args)):
            print('WRONG! ans=%s, args=%s' % (ans, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_slow_solution(solution, inputs_gen, solution_slow):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        slow = solution_slow(*deepcopy(args))
        if ans != slow:
            print('WRONG! ans=%s, slow=%s, args=%s' % (ans, slow, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


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

read = input
read_int = lambda: int(input())
read_array = lambda sep=None, maxsplit=-1: input().split(sep, maxsplit)
read_int_array = lambda: [int(a) for a in read_array()]

# endregion

if __name__ == "__main__":
    main()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:



def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g




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

Submission status: Wrong Answer

Solution code:
N,K = [int(i) for i in 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)
elif n==k:print(0)
elif n>k: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())
ans = n-k if k > 1 else 0
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n,k = readInts()
if k == 1:
    print(0)
else:
    if n >= k:
        print(n-k)

Submission status: Accepted

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


N, K = LI()

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

Submission status: Accepted

Solution code:
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
import sys
def input():
    return sys.stdin.readline()[:-1]

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

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

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

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:
  x = N-K
  print (x)

Submission status: Accepted

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

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

print(n-k)

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

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:
import sys, math
from collections import deque

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(0 if b == 1 else 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:
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,K=map(int,pin().split())
  if K==1:
    print(0)
    return 
  t=N-K 
  print(t)
  return 

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:
#diverta 2019 Programming Contest 2 a
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)

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())
print(n-k 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:
a = [int(s) for s in input().split()]
b = a[0] - a[1] + 1
c = a[0] // a[1]
print(int(b - c))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, K = map(int, readline().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())
print(n%k)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, K = LI()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

if y==1:
  print(0)
  exit()
else:
  print(x-y)

Submission status: Accepted

Solution code:
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())
print(max((n % k - n // k + 1),0))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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 = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Submission status: Accepted

Solution code:
print(eval(input().replace(' ','%')))

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

Submission status: Accepted

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

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

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:
a,b = map(int,input().split())
x = []
for i in range(b):
    x.append(1)
    a = a - 1
for i in range(a):
    x[0] = x[0] + 1
x.sort()
print(abs(x[0] - x[len(x) - 1]))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
ans = 0
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(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(_) for _ 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)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
# n = int(input())
# li = list(map(int, input().split()))
print(0 if k == 1 else 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:
def main():
    N, K = map(int, input().split())
    if K == 1:
        print(0)
        exit()

    print(N - K)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    n, k = mi()
    if k == 1:
        print(0)
    else:
        print(n - k)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    if K==1:
        print(0)
    else:
        print(N-K)

main()

Submission status: Accepted

Solution code:
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,input().split())

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

else:

    ans=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=map(int,input().split());print(0 if k<=1 else 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:
def resolve():
    A, B = map(int, input().split())
    print("0" if B == 1 else A-B)
resolve()

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N, K = MAP()

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

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

Submission status: Accepted

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

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