#include <bits/stdc++.h>
using namespace std;
int T;
double n;
int main() {
  cin >> T;
  while (T-- > 0) {
    cin >> n;
    printf("%.9lf\n", (1.0 / (2.0 * sin(acos(-1.0) / (2.0 * n)))) *
                          cos(acos(-1.0) / 2 / n) * 2);
  }
}
