E = Math::E def f(x, n) n = n.to_f E * x - E * (x**3 / n**2) / 6 + E * (x**5 / n**4) + 31 * E * (x**7 / n**6) / 5040 end T = gets.to_s.to_i a = 1/(Math::E * Math::PI**2) T.times do n = gets.to_s.to_i puts f(a, n) - f(0, n) end