#include <bits/stdc++.h>
using namespace std;
const int inf = 1012345678;
const double pi = acos(-1.0);
void solve() {
  cout << std::setprecision(20);
  int n;
  cin >> n;
  float ans = cos(pi / (4 * n)) / sin(pi / (2 * n));
  cout << ans << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
