#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  n *= 2;
  long double alpha = 180.0 / n;
  long double r = 1.0 / (2.0 * sin(alpha * 3.14159265 / 180.0));
  long double cosres = cos(0.5 * alpha * 3.14159265 / 180.0);
  long double res = r * cosres * 2;
  cout << setprecision(12) << res << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
