#include <bits/stdc++.h>
using namespace std;
bool All(long long index[]) {
  for (int i = 0; i < 3; i++) {
    if (index[i] == -1) return false;
  }
  return true;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    cout << fixed << setprecision(9) << 1 / (double)tan(3.14159265359 / (2 * n))
         << endl;
  }
  return 0;
}
