#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1.0);
void solve() {
  long long n;
  cin >> n;
  long double ang = PI / (n * 1.0);
  long double r = 0.5 / sin(ang / 2.0);
  long long aux = n / 2;
  long double a = ang * (aux * 1.0);
  long double l = 2 * (r * (sin(a / 2.0) + cos(a / 2.0)));
  l = l * sqrt(2) / 2.0;
  cout << l << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
