#include <bits/stdc++.h>
using namespace std;
struct node {
  vector<int> v;
  int s = 0;
  int e = 0;
};
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
bool cmp(pair<int, int> p1, pair<int, int> p2) { return p1.second > p2.second; }
struct mycmp {
  constexpr bool operator()(pair<int, int> const& p1,
                            pair<int, int> const& p2) const noexcept {
    return p1.second < p2.second;
  }
};
bool isprime(int n) {
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
void solve() {
  int n;
  cin >> n;
  double ans = 1.0 / tan(acos(-1) / n / 2);
  cout << setprecision(10) << ans << '\n';
}
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    solve();
    t--;
  }
  return 0;
}
