N, K = map(int, input().split())
a = N//K
print(N-a*K) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K a = N//K a N//K N K print(N-a*K) print N-a*K N a*K a K K = map(int, input().split()) map(int, input().split()) K a = N//K N//K a N, K = map(int, input().split()) map(int, input().split()) N
N, K = map(int, input().split())
a = N//K
print(N-a*K)