#include <bits/stdc++.h>
using namespace std;
void shikhar7s(long long int cas) {
  long long int n, i;
  cin >> n;
  double d = tan(3.141592653589793 / (2 * n));
  d = (1.0) / d;
  cout << setprecision(12) << d << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  cin >> t;
  long long int cas = 1;
  while (cas <= t) {
    shikhar7s(cas);
    cas++;
  }
  return 0;
}
