#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 5;
const int mod = 10007;
const double pi = acos(-1.0);
int main() {
  int t;
  double n;
  cin >> t;
  while (t--) {
    cin >> n;
    int half = n / 2;
    double a = 45, bb = 180 / n, b = half * bb / 2;
    double c = (180.0 - a - b) * pi / 180;
    double d = (n - 1) * pi / 2 / n;
    double x = sin(d) / sin(bb * pi / 180);
    printf("%lf\n", 2 * sin(c) * x);
  }
}
