#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3f;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void zz() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
const double pi = 3.1415926535897932;
double polydiagonal(double n, double a) {
  if (a < 0 && n < 0) return -1;
  double rad = (pi / n);
  return (double)(1 / sin(rad));
}
int32_t main() {
  zz();
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    double x = pi / (4 * n);
    double ans = sin(x) * 2;
    ans = 1 / ans;
    cout << fixed << setprecision(10) << ans << endl;
  }
}
