#include <bits/stdc++.h>
using namespace std;
int64_t binexp(int64_t base, int64_t exponent) {
  int64_t res = 1;
  base = (base + 1000000007) % 1000000007;
  while (exponent) {
    if (exponent & 1) {
      res = (res * base) % 1000000007;
    }
    exponent = exponent >> 1;
    base = (base * base) % 1000000007;
  }
  return res;
}
void solve() {
  double n;
  cin >> n;
  n = 2.0 * n;
  double param, result;
  param = (3.14159265 / n);
  result = sin(param);
  double ans1 = (1.0 / (result));
  double res = cos(param / 2.0);
  double ans2 = (1.0 * res);
  double ans = (ans1 * ans2);
  printf("%.10f\n", ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
