N,K = [int(i) for i in input().split()]

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

print(((N-K)//(K-1) + 1 if (N-K)%(K-1) ==0 else (N-K)//(K-1) + 2))

N,K = [int(i) for i in input().split()]

print(((N-K)//(K-1) + 1 if (N-K)%(K-1) == 0 else (N-K)//(K-1) + 2))

N, K = [int(i) for i in input().split()]
n = list(map(int, input().split()))
print(((N - K) // (K - 1) + 1 if (N - K) % (K - 1) == 0 else (N - K) // (K - 1) + 2))

N, K = [int(i) for i in input().split()]
print(((N - K) // (K - 1) + 1 if (N - K) % (K - 1) == 0 else (N - K) // (K - 1) + 2))

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