#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
const double pi = 3.1415926536;
void solve() {
  double n;
  cin >> n;
  double th = (pi) / (2.0 * n);
  double ans = 1.0 / tan(th);
  cout << fixed << setprecision(10) << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int test_case = 1; test_case <= t; ++test_case) {
    solve();
  }
}
