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