#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 1e6 + 5, LG = 18;
const double pi = acos(-1);
const long long mod = 1e9 + 7;
mt19937_64 rnd(239);
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x %= p;
  while (y) {
    if (y & 1) res = (res * x) % p;
    y >>= 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    double ans = 1.0 / tan(pi / (2.0 * n));
    cout << fixed << setprecision(10) << ans << "\n";
  }
  return 0;
}
