#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926;
int main() {
  int t;
  cin >> t;
  cout << fixed << setprecision(7);
  while (t--) {
    int n;
    cin >> n;
    double x = 1.0 / (2 * tan(pi / (2 * n))) + 1.0 / (2 * sin(pi / (2 * n)));
    cout << sqrt(0.25 + x * x) << '\n';
  }
}
