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

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

ans = ((N - 1) + (K - 1 - 1)) // (K - 1)

print(ans)

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

ans = 1 + ((N - K) + (K - 2)) // (K - 1)

print(ans)

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = ((N - 1) + (K - 1 - 1)) // (K - 1)
print(ans)

N, K = list(map(int, input().split()))
ans = 1 + ((N - K) + (K - 2)) // (K - 1)
print(ans)

-A = list(map(int, input().split())) -ans = ((N - 1) + (K - 1 - 1)) // (K - 1) +ans = 1 + ((N - K) + (K - 2)) // (K - 1)