#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long SIZE = 100000;
const int INF = 0x3f3f3f3f;
const long long ll_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acos(-1);
const long long MAXN = numeric_limits<long long>::max();
const long long MAX = 2000000;
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
vector<long long> prime;
long long a[MAX];
void SOE() {
  memset(a, 1, sizeof(a));
  for (long long i = 2; i * i <= MAX; i++) {
    if (a[i])
      for (long long j = i * i; j <= MAX; j += i) {
        a[j] = 0;
      }
  }
  for (long long i = 2; i < MAX; i++)
    if (a[i]) prime.push_back(i);
}
map<long long, long long> powers;
vector<long long> PrimeFactors(long long n) {
  vector<long long> v;
  if (n % 2 == 0) {
    v.push_back(2);
  }
  while (n % 2 == 0) {
    n = n / 2;
    powers[2]++;
  }
  for (long long i = 3; i <= sqrt(n); i++) {
    if (n % i == 0) v.push_back(i);
    while (n % i == 0) {
      n = n / i;
      powers[i]++;
    }
  }
  if (n > 2) {
    v.push_back(n);
    powers[n]++;
  }
  return v;
}
long long FastModExpo(long long x, long long y, long long m) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % m;
    }
    x = (x * x) % m;
    y = y >> 1;
  }
  return res;
}
long long diffbits(long long x, long long y) {
  long long a = x ^ y;
  long long ans = __builtin_popcountll(a);
  return ans;
}
long long vis[100001];
vector<long long> adj[100001];
void dfs(long long u) {
  vis[u] = 1;
  for (auto x : adj[u]) {
    if (vis[x] == 0) dfs(x);
  }
}
void solve() {
  long long n;
  cin >> n;
  double theta = PI / (2 * n);
  double perp = 0.5;
  double base = perp / (tan(theta));
  base *= 2;
  cout << fixed << setprecision(12) << base << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
