fork download
  1. #include <iostream>
  2.  
  3. #define _USE_MATH_DEFINES
  4.  
  5. #include <cmath>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. ios_base::sync_with_stdio(false);
  11. cin.tie(0);
  12. cout.tie(0);
  13. cout.precision(17);
  14. int t;
  15. cin >> t;
  16. while (t--) {
  17. double n;
  18. cin >> n;
  19. cout << 1 / cos(M_PI / (2*n)) << endl;
  20. }
  21. }
Success #stdin #stdout 0s 4508KB
stdin
3
3
5
199
stdout
1.1547005383792515
1.0514622242382672
1.00003115407639