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