W, D = [int(input()) for i in range(2)] for d in range(D, 1, -1): W -= int(W/d ** 2) print(W)