#include <bits/stdc++.h>
using namespace std;
int t;
long double pi = 3.141592653589793116;
long double solve() {
  long double n;
  cin >> n;
  long double ans = 0LL;
  for (int i = int(0); i < int(2 * n); ++i) {
    long double li = (long double)i;
    long double u =
        sin(pi / 4 + pi / (2.0 * n) + i * (pi / n)) / sin(pi / (2.0 * n));
    ans = max(ans, u);
  }
  return ans;
}
int main() {
  cin >> t;
  cout << setprecision(20) << fixed;
  for (int i = int(0); i < int(t); ++i) {
    cout << solve() << endl;
  }
  return 0;
}
