# No.51 やる気の問題 w = int(input()) d = int(input()) for i in range(d - 1): w -= w // (d - i) ** 2 print(w)