#include <bits/stdc++.h>
using namespace std;
mt19937 rng_32(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e5 + 10;
const double pi = acos(-1);
int main() {
  int cas;
  cin >> cas;
  double n;
  while (cas--) {
    cin >> n;
    printf("%.10lf\n", cos(pi / 4.0 / n) / sin(pi / 2.0 / n));
  }
  return 0;
}
