#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
void solve() {
  long long i, j, n;
  cin >> n;
  double l = 0.5 / (sin(3.1415926535897932384626 / (2 * n)));
  double n1 = n / 2;
  double n2 = (n + 1) / 2;
  double ans = l * (sqrt(2.0)) *
               (cos((n1 * 3.1415926535897932384626) / (2 * n)) +
                cos((n2 * 3.1415926535897932384626) / (2 * n)));
  cout << fixed << setprecision(9) << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
