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