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

pole = 0
for i in range(n):
    if a[i] == 1:
        pole = i

l = pole
r = n - 1 - pole

for i in range(k - 1):
    if l % (k - 1) == i:
        if k - i - 1 >= r:
            if l == 0:
                print(0)
            else:
                print(1 + int(l / (k - 1)))
        else:
            if l == 0:
                print(1 + int((r - k + i + 1) / (k - 1)))
            else:
                print(1 + int(l / (k - 1)) + 1 + int((r - k + i + 1) / (k - 1)))