#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;
long long modexp(long long a, long long b, long long m) {
  long long r = 1;
  a = a % m;
  while (b > 0) {
    if (b & 1) r = (r * a) % m;
    b = b / 2;
    a = (a * a) % m;
  }
  return r % m;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    double ans =
        ((double)cos((double)3.1415926535897932384626 / (double)(4 * n)) /
         (sin((double)3.1415926535897932384626 / (double)(2 * n))));
    cout << std::fixed << setprecision(13) << ans << '\n';
  }
  return 0;
}
