#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double angle =
        360 * 3.1415926535897932384626433832795028841971 / (180 * 4 * n);
    double ans = 1 / tan(angle);
    std::cout << std::fixed;
    std::cout << std::setprecision(9);
    cout << ans << "\n";
  }
}
