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

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

for i, v in enumerate(a):

    if v == 1:

        ind1 = i

        break



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

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

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



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

print(ans)
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
for i, v in enumerate(a):
    if v == 1:
        ind1 = i
        break
ans = -((-n + 1) // (k - 1))
print(ans)

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = -((-n + 1) // (k - 1))
print(ans)

-for i, v in enumerate(a): -    if v == 1: -        ind1 = i -        break