#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int maxn = 2e5 + 10;
void solve() {
  int n;
  scanf("%d", &n);
  n *= 2;
  double d = (double)180 * (n - 2) / n;
  printf("%.7f\n", tan(d / 360 * PI));
}
int main() {
  int T;
  cin >> T;
  while (T--) solve();
  return 0;
}
