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