#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    long long int n;
    cin >> n;
    cout << fixed << setprecision(9) << 1 / tan(3.14159265358979 / (2 * n))
         << endl;
  }
}
