#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
struct edge {
  int to, next, v;
} e[2000005 << 1];
int head[2000005], tot;
void add(int x, int y, int z) {
  tot++;
  e[tot].to = y;
  e[tot].v = z;
  e[tot].next = head[x];
  head[x] = tot;
}
const double PI = 3.1415926535;
void solve() {
  int n;
  scanf("%d", &n);
  printf("%.9lf\n", (double)1.0 / tan(PI / (double)2 / (double)n));
}
int main() {
  int T = 1;
  scanf("%d\n", &T);
  while (T--) {
    solve();
  }
  return 0;
}
