#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  cin.ignore();
  while (t) {
    long double n;
    cin >> n;
    long double pi_by_2 = acos(0.0);
    long double result = 1 / tan(pi_by_2 / n);
    cout << fixed;
    cout << setprecision(6) << result << endl;
    t--;
  }
}
