#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    n *= 2;
    double th = 360.0 / (double)n;
    th /= 2.0;
    th =
        th *
        3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 /
        180.0;
    double ans = 2.0 * (0.5 / tan(th));
    cout << setprecision(10) << fixed << ans << "\n";
  }
  return 0;
}
