#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int mo = 1e9;
long long ksm(long long a, long long b) {
  if (b < 0) return 0;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
int t;
double n;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lf", &n);
    const double pi = acos(-1.0);
    double s = cos(pi / (4 * n)) / sin(pi / (2 * n));
    printf("%.9f\n", s);
  }
  return 0;
}
