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

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



print((1 + -( -(N-K)//(K-1) ) ))

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

print((1 + -( -(N-K)//(K-1) ) ))

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

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

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