#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    long long n;
    cin >> n;
    double x = 3.1415926535897932 / (2 * n);
    double t = tan(x);
    double p = sin(x);
    double ans = n * 4;
    ;
    double dia = 1 / p;
    long long i = n / 2;
    double k = dia * (sin(i * x) + sin((n - i) * x)) / sqrt(2);
    ans = min(ans, k);
    cout << setprecision(20) << ans << endl;
  }
  return 0;
}
