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

A = [int(x) for x in input().split()]



n = N - K

if n % (K - 1) == 0:

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

else:

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

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

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

n = N - K

if n % (K - 1) == 0:

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

else:

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

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

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
n = N - K
if n % (K - 1) == 0:
    ans = 1 + n // (K - 1)
else:
    ans = 2 + n // (K - 1)
print(ans)

-A = [int(x) for x in input().split()] +A = list(map(int, input().split()))