#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, q;
  scanf("%d", &t);
  for (q = 1; q <= t; q++) {
    int n;
    cin >> n;
    n *= 2;
    double radious = 1 / (tan(acos(-1) / n));
    if (n == 4)
      cout << 1 << endl;
    else {
      cout << fixed << setprecision(9) << radious << endl;
    }
  }
  return 0;
}
