#include <bits/stdc++.h>
using namespace std;
const double pi = std::acos(-1);
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double ans =
        sqrt(((double)1 / (sin(pi / (2 * n)) * sin(pi / (2 * n)))) - 1);
    printf("%0.9lf", ans);
    cout << endl;
  }
}
