#include <bits/stdc++.h>
using namespace std;
const double eps = 0.5;
const double pi = acos(-1.0);
const long long INF = 2e18;
const int maxn = 100005;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    n = n + n;
    double ans = cos(pi / (2.0 * n)) / (sin(pi / (1.0 * n)));
    printf("%.10f\n", ans);
  }
  return 0;
}
