#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double ans = 1.0 / tan(3.14159265357 / n / 2);
    cout << fixed << setprecision(12) << ans << "\n";
  }
}
