W = int(input()) D = int(input()) for i in range(D): ans = W W -= W//(D**2) D -= 1 print(ans)