import math

N, K, *A = list(map(int, open(0).read().split()))

print((math.ceil((N-1)/(K-1))))

import math

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

print((math.ceil((N-1)/(K-1))))

import math

N, K, *A = list(map(int, open(0).read().split()))
print((math.ceil((N - 1) / (K - 1))))

import math

N, K = list(map(int, input().split()))
print((math.ceil((N - 1) / (K - 1))))

-N, K, *A = list(map(int, open(0).read().split())) +N, K = list(map(int, input().split()))