#include <bits/stdc++.h>
using namespace std;
int T, n, k, a[100005];
const double PI = acos(-1.0);
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    double ang = PI / (2 * n);
    printf("%.10f\n", 1.0 / sin(ang) * cos(ang / 2.0));
  }
  return 0;
}
