#include <bits/stdc++.h>
using namespace std;
void solve() {
  double n;
  cin >> n;
  cout << setprecision(9) << (1.0 / tan(acos(-1) / (2 * n))) << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T_ = 1;
  cin >> T_;
  for (int i = 0; i < T_; i++) solve();
  return 0;
}
