w = gets.to_i d = gets.to_i s = w (d - 1).times do |x| s -= s / (d - x) ** 2 end puts s