#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    double z = 1.0 / (2.0 - 2.0 * cos(acos(-1.0) / (n * 1.0)));
    z = sqrt(z);
    double x1 = sin(acos(-1.0) / (n * 1.0) * round(n / 4.0)) * z * sqrt(2.0);
    double x2 =
        sin(acos(-1.0) / 2.0 - (acos(-1.0) / (n * 1.0) * round(n / 4.0))) * z *
        sqrt(2.0);
    x1 += x2;
    printf("%.9lf\n", x1);
  }
  return 0;
}
