#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  double pie = 3.14159265358979323846;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long double ans = pie / n;
    long double ac1 = ans;
    long double ans1 = (double)1 / (sin(ans / 2));
    long double ans2 = (sin(ans) + cos(ans)) / sqrt(2);
    ans2 *= ans1;
    long double mina = ans2;
    for (int i = 1; i <= ((n / 2 + 1)); ++i) {
      ans = ac1;
      ans *= i;
      ans1 = (double)1 / (sin(ac1 / 2));
      ans2 = (sin(ans) + cos(ans)) / sqrt(2);
      ans2 *= ans1;
      mina = max(ans2, mina);
    }
    cout << setprecision(10) << mina << "\n";
  }
  return 0;
}
