n,k = input().split() n,k = int(n),int(k) ans = (n-1)%(k+1) print(ans) while True: if int(input())>=n: break ans += k+1 print(ans)