#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long maxn = 1e5 + 5;
long long power(long long a, long long b, long long m);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  long double pi = 2 * acos(0.0);
  cin >> t;
  while (t--) {
    long double n;
    cin >> n;
    long double tw = 2.0 * n;
    long double r = pi / tw;
    long double ans = tan(r);
    long double te = 1.0;
    ans = te / ans;
    cout << fixed << setprecision(10) << ans << "\n";
  }
  return 0;
}
long long power(long long a, long long b, long long m) {
  if (a == 0) return 0;
  if (b == 0) return 1;
  if (b == 1) return a;
  long long p = power(a, b / 2, m);
  p = (p * p) % m;
  if (b & 1) {
    p = (p * (a % m)) % m;
  }
  return p;
}
