#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
const int mod = 1e9 + 7;
const long long INF = 1e18;
const double PI = acos(-1);
void rua() {
  int n;
  scanf("%d", &n);
  printf("%.10f\n", cos(PI / (4.0 * n)) / sin(PI / (2.0 * n)));
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) rua();
  return 0;
}
