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:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの整数の入力
#w = [x for x in map(int, input().split())]
n, k = map(int, input().split())
print("sp", n, k, file=sys.stderr)
#p, q, r = map(int, input().split())

# 改行区切りの整数の入力
a = []
#for x in range(m):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#print(a, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re

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

#print(doit([0] * 4))
#doit(s)
try:
  print(doit())
except Exception as e:
  print("e", e, file=sys.stderr)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline

N, K = map(int, readline().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 = list(map(int,input().split()))
print(n%k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


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

    return N - K


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
    result = solve(N, K)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
balls, men = map(int,input().split())

if men == 1:
  print(0)
else:
  print(balls - men)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())
n, k = readmi()
if k == 1:
    print(0)
else:
    a = n - k
    print(a)

Submission status: Accepted

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


# 89 人　は一つしか貰えないが、１人は11個もらえる
 
others = k - 1  # 最大限に貰えないひとたちの人数
min_num = 1
max_num = n - others
 

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

Submission status: Accepted

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

Submission status: Accepted

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 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)
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())
print(a-b) if b-1 else print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs = [int(s) for s in input().split()]
n = inputs[0]
k = inputs[1]

rest = n - k

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

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:
# coding: utf-8
# Your code here!

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

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

Submission status: Accepted

Solution code:
n, k = [int(v) for v 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>=2:
    ans=n-(1*k)
    print(ans)
else:
    ans=0
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().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:

from collections import defaultdict
def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    else:
        print(a - b)






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:
data = []

data.extend(list(map(int, input().split(" "))))
N = data[0]
K = data[1]

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

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

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(result)

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)

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

Submission status: Accepted

Solution code:
line = input().split()
a, b = int(line[0]), int(line[1])
print(a%b)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if K > 1:
    remains = N - K
else:
    remains = 0

print(remains)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*- coding: utf-8
#  -*-
"""
oj dl https://atcoder.jp/contests/abc116/tasks/abc116_d -d test-d
oj test -d test-d -c "python abc116d.py"
oj test -d test-d -c "python abc116d.py" test-d/sample-3.in
"""
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n, k):
    if n % k == 0:
        return 0
    else:
        md = n % k
        dv = n / k
        return md



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    k = int(parsed_lines[0][1])
    # S = parsed_lines[1][0]
    # return n, k, S
    return n, k


if not do_submit:
    n, k = input_parse("""
    3 2
    """)
    print(sol(n, k))

    n, k = input_parse("""
    3 1
    """)
    print(sol(n, k))
    n, k = input_parse("""
    8 5
    """)
    print(sol(n, k))

else:
    n, k= list(map(int, input().split()))
    # S = input().split()
    # print(sol(n, k, S))
    #n = int(input().strip())
    # S = input().strip()
    print(sol(n, k))

Submission status: Accepted

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

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

if (1 == K):
  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 = 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())

if K == 1:
  out =0
else:
  # 1以外
  nokori = N - K
  mx = nokori + 1
  mn = 1
  out = mx-mn

print(out)

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:
class BallDistribution:
    def __init__(self):
        self.N, self.K = map(int, input().split())

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


ballDistribution = BallDistribution()
ballDistribution.max_number()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10000)
mod = 1000000007


def mul(a, b):
    return ((a % mod) * (b % mod)) % mod


def power(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x % mod
    elif y % 2 == 0:
        return power(x, y / 2) ** 2 % mod
    else:
        return power(x, y / 2) ** 2 * x % mod


def div(a, b):
    return mul(a, power(b, mod - 2))


# def gcd(a_gcd, b_gcd):
#     while b_gcd != 0:
#         a_gcd, b_gcd = b_gcd, a_gcd % b_gcd
#     return a_gcd
#
#
# def lcm(a_lcm, b_lcm):
#     return a_lcm * b // gcd(a_lcm, b_lcm)
#
#
# def max_sum(N_max_sum, a_max_sum):
#     dp = [0] * (N_max_sum + 1)
#     for i in range(N_max_sum):
#         dp[i + 1] = max(dp[i], dp[i] + a_max_sum[i])
#     return dp[N]
#
#
# def knapsack(N_knapsack, W, weight, value):
#     inf = float("inf")
#     dp = [[-inf for _ in range(W+1)] for j in range(N_knapsack + 1)]
#     for i in range(W+1):
#         dp[0][i] = 0
#
#     for i in range(N_knapsack):
#         for w in range(W+1):
#             if weight[i] <= w:
#                 dp[i+1][w] = max(dp[i][w-weight[i]]+value[i], dp[i][w])
#             else:
#                 dp[i+1][w] = dp[i][w]
#     return dp[N_knapsack][W]
#
#
# class UnionFind:
#     def __init__(self, n):
#         self.par = [i for i in range(n+1)]
#         self.rank = [0] * (n+1)
#
#     # 検索
#     def find(self, 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 = self.find(x)
#         y = self.find(y)
#         if self.rank[x] < self.rank[y]:
#             self.par[x] = y
#         else:
#             self.par[y] = x
#             if self.rank[x] == self.rank[y]:
#                 self.rank[x] += 1
#
#     # 同じ集合に属するか判定
#     def same_check(self, x, y):
#         return self.find(x) == self.find(y)


ans = 0

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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

  print(n - k)
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

if K==1:
  print(0)

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

Submission status: Accepted

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

Submission status: Accepted

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

data_dict = {}

for k in range(K):
    data_dict[k] = 0

for n in range(N):
    if n in data_dict:
        if data_dict[n] == 0:
            data_dict[n] = 1
    else:
        data_dict[0] += 1

print(data_dict[0] - data_dict[K - 1])

Submission status: Accepted

Solution code:
import numpy as np
#A = str(input())
#A = "ABCABC"
#N = int(input())
[N,K] = list(map(int,input().split()))
if K == 1:
    print(0)
else:
    print(N-K)

Submission status: Accepted

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

Submission status: Accepted

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

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:
a,b=map(int,input().split())
c=int(0)
if b==1:
    print(c)
else:
    d=a-b
    print(d)

Submission status: Accepted

Solution code:
import sys
args = sys.stdin.readlines()
tmp = [int(x) for x in args[0].split(' ')]
N, K = tmp[0], tmp[1]

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

Submission status: Accepted

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

a=0

if k != 1:
  a=n-k
 
print(a)

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

Submission status: Accepted

Solution code:
# 2019 6/15
# diverta 2019 A Ball Distribution

import sys

ball, human = list(map(int, input().split()))

if human == 1:
    print(0)
    sys.exit()
elif ball >= human:
    print(ball - human)
    sys.exit()

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
if K == 1:
    print("0")
else:
    print(N-1-(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:
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 == 1 or 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:
numbers = input()
numbers = numbers.split(" ")
ball_number = int(numbers[0])
person_number = int(numbers[1])

result = 0

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

Submission status: Accepted

Solution code:
# coding:utf-8
if __name__=='__main__':
    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())

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

Submission status: Accepted

Solution code:
a=[]
for x in input().split(" "):
    a.append(int(x))

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N, K = map(int, stdin.readline().rstrip().split())

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

main()

Submission status: Accepted

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

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)

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

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:
splited = input().split(' ')
N = int(splited[0])
K = int(splited[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)
elif N > K:
    print(N - K)
elif N == K:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
import sys

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

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

ans = n - k
print(ans)

Submission status: Accepted

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

N, K = rrm()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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


if __name__ == '__main__':
    N, K = [int(x) for x in stdin.readline().rstrip().split()]
    print(solve(N, K))
    
    # test
    # print(1 == solve(3,2))
    # print(0 == solve(3,1))
    # print(3 == solve(8,5))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
if n % k == 0:
  print(0)
else:
  print(n // k + n % k - 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 N < K or K==1:
  print(0)
else:
  print(N-K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a, b = s.split(" ")
a, b = int(a), int(b)
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:
data = list(map(int,input().split()))
n = data[0]
k = data[1]
del data
if k > 1:
    if n >= k:
        print(n-k)
    elif n < k:
        print("1")
else:
    print(0)

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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 = [int(c) for c 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:
    left=N-K
    print(left)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

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

def get_stdin():
    return input()

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
from sys import stdin

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
N, K = map(int, input().split())
if K == 1:
    ans = 0
else:
    ans = N - K
print(ans)

Submission status: Accepted

Solution code:
import logging
import unittest

debug = logging.getLogger(__name__).debug


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


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


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

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


if __name__ == '__main__':
    _main()