n=gets.to_i n.times do |i| a=gets.to_i if a == 1 puts 0.1012977284 elsif a <= 100 puts (Math.exp(1) + Math.exp(Math.cos(1/(Math.exp(1)/(Math.PI**2)/a ))))/2.0 else puts 0.1013211836 end end