#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    double angle = 360.0 / (2 * n);
    if (n == 2)
      cout << 1 << '\n';
    else {
      double ans = 1 / tan(angle * (3.1415926) / 360.0);
      cout << std::fixed << std::setprecision(9) << ans << '\n';
    }
  }
}
