#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
const int mod = 998244353;
const long long INF = 0x7f7f7f7f7f7f7f7f;
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    double jiaodu = 360.0 / (2 * n);
    double need = (180 - jiaodu) / 2;
    printf("%lf\n", tan(need / 180 * 3.1415926535898));
  }
}
