w, = map(int, input().split()) d, = map(int, input().split()) for i in range(d, 1, -1): w -= w//i**2 print(w)