#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const double pi = acos(-1);
const double sq2 = sqrt(2);
void solve() {
  int n;
  cin >> n;
  double tt = pi / n, k = 1.0 / 2 / sin(tt / 2);
  double a = n / 2, b = n - a;
  cout << setiosflags(ios::fixed) << setprecision(9)
       << k * (sqrt(1 - cos(tt * a)) + sqrt(1 - cos(tt * b))) << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
