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

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

print((-((1-n)//(k-1))))
print((eval("-(-~-"+input().replace(" ","//~-")+")")))
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
print((-((1 - n) // (k - 1))))

print((eval("-(-~-" + input().replace(" ", "//~-") + ")")))

-n, k = list(map(int, input().split())) -a = list(map(int, input().split())) -print((-((1 - n) // (k - 1)))) +print((eval("-(-~-" + input().replace(" ", "//~-") + ")")))