
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)) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i n, k = [int(i) for i in input().split()] n [int(i) for i in input().split()] k 1 for i in range(k) for i in range(k) i range(k) range k for i in range(k) 1 ans = [1 for i in range(k)] ans [1 for i in range(k)] ans[-1] += n - sum(ans) ans[-1] ans -1 n - sum(ans) n sum(ans) sum ans print(max(ans) - min(ans)) print max(ans) - min(ans) max(ans) max ans min(ans) min ans ans = [1 for i in range(k)] [1 for i in range(k)] ans n, k = [int(i) for i in input().split()] [int(i) for i in input().split()] n k = [int(i) for i in input().split()] [int(i) for i in input().split()] k

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