#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    if (n == 2)
      printf("1.000000000\n");
    else {
      double angle = 360.0 / (4.0 * n);
      if (angle >= 180) angle -= 180.0;
      double cot = 1.0 / tan(angle / 180.0 * pi);
      printf("%.8f\n", cot);
    }
  }
  return 0;
}
