#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
int main() {
  int T;
  cin >> T;
  while (T--) {
    double n;
    cin >> n;
    double t = floor(n / 4 + 0.5);
    double xita1 = t * pi / n;
    double l = 0.5 / sin(pi / (n + n));
    double xita2 = pi - xita1 - pi / 4;
    double x = l * sin(xita2) / sin(pi / 4);
    printf("%.16llf\n", x / sin(pi / 4));
  }
  return 0;
}
