#include <bits/stdc++.h>
using namespace std;
char s[200001];
int main(void) {
  int T;
  scanf("%d", &T);
  while (T--) {
    double n;
    scanf("%lf", &n);
    double t = tan(((double)90.0 / n) * 3.14159265358979 / 180);
    double ans = 1 / t;
    printf("%lf\n", ans);
  }
  return 0;
}
