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

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



ans = 0

while n > 0:

    if ans == 0:

        n -= k

    else:

        n -= (k-1)

    ans += 1

print(ans)

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

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



import math

ans = math.ceil((n-1)/(k-1))

print(ans)
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = 0
while n > 0:
    if ans == 0:
        n -= k
    else:
        n -= k - 1
    ans += 1
print(ans)

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
import math

ans = math.ceil((n - 1) / (k - 1))
print(ans)

-ans = 0 -while n > 0: -    if ans == 0: -        n -= k -    else: -        n -= k - 1 -    ans += 1 +import math + +ans = math.ceil((n - 1) / (k - 1))