P = 1000 count = 0 for _ in range(P): n, k = map(int, input().split()) while n>1: n = n-(k+1) if n==1: #print('Lose') pass else: #print('Win') count += 1 print(count)