#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const double pi = 3.141592653589793;
double x, z, l;
long long T, y, n;
signed main() {
  cin >> T;
  while (T--) {
    cin >> n;
    x = 0;
    z = pi / 2 / n;
    l = 1.0 / 2 / sin(pi / 2 / n);
    while (z <= pi / 2) x = max(x, l * 2 * (cos(z) + sin(z))), z += pi / n;
    printf("%.9lf\n", x * sqrt(2) / 2);
  }
  return 0;
}
