#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int dir[4][2] = {-1, 0, 1, 0, 0, -1, 0, 1};
const int exdir[4][2] = {1, 1, 1, -1, -1, 1, -1, -1};
long long qpow(long long x, long long y) {
  long long ans = 1, t = x;
  while (y > 0) {
    if (y & 1) ans *= t, ans %= mod;
    t *= t, t %= mod;
    y >>= 1;
  }
  return ans % mod;
}
double pi = acos(-1.0);
void solve() {
  int n;
  cin >> n;
  printf("%.8f", 1 / tan(pi / (2 * n)));
}
int main() {
  int t;
  cin >> t;
  while (t--) solve(), cout << '\n';
  return 0;
}
