N, K, *A = list(map(int, open(0).read().split()))

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

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

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

N, K, *A = list(map(int, open(0).read().split()))
print((-(-(N - 1) // (K - 1))))

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

-N, K, *A = list(map(int, open(0).read().split())) +N, K = list(map(int, input().split()))