#include #include #include double fnc(double x){ return std::exp(std::cos(x)); } constexpr double E = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274; constexpr double REC_E_PI_SQ = 0.0372739804171723022424089344791876134444808019989621640823907769743547772695024254310945085466479157; double solve(double n){ return ( fnc(REC_E_PI_SQ / n) * 7 + fnc(REC_E_PI_SQ * 0.75 / n) * 32 + fnc(REC_E_PI_SQ * 0.5 / n) * 12 + fnc(REC_E_PI_SQ * 0.25 / n) * 32 + E * 7 ) * REC_E_PI_SQ / 90; } int main(){ int t; std::cin >> t; for(int i = 0; i < t; ++i){ double n; std::cin >> n; std::cout << std::setprecision(12) << solve(n) << std::endl; } }