#include <bits/stdc++.h>
using namespace std;
long long mod(long long n) {
  n %= 1000000007;
  if (n < 0)
    return n + 1000000007;
  else
    return n;
}
void solve() {
  long double n;
  cin >> n;
  n = 2 * n;
  if (n == 4) {
    cout << 1.0000 << "\n";
    return;
  }
  cout << setprecision(12);
  long double theta = (long double)180 / n;
  long double rd = (3.141592653589793238 * 2 * theta) / 360;
  cout << 1 / tan(rd) << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
