#include <bits/stdc++.h>
using namespace std;
int t, n;
int main() {
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    scanf("%d", &n);
    double a, b, c;
    a = 1.0 / (2 * sin(3.1415926535 / (2 * n)));
    b = 1.0 / (2 * tan(3.1415926535 / (2 * n)));
    c = min(a, b);
    printf("%.10lf\n", 2 * c);
  }
}
