#include <bits/stdc++.h>
using namespace std;
double side_len(double radius, double angle) {
  return 2.0 * radius * sin(M_PI * angle / (2 * 180));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    double n;
    double ans;
    cin >> n;
    double radius = 1.0 / (2.0 * sin(M_PI / (2 * n)));
    double angle = 180 / n;
    double l = side_len(radius, (n - 1) / 2 * angle);
    double r = side_len(radius, (n + 1) / 2 * angle);
    cout << fixed << setprecision(9) << (l * M_SQRT1_2) + (r * M_SQRT1_2)
         << "\n";
  }
  return 0;
}
