#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    n *= 2;
    cout << fixed << setprecision(9)
         << 1.0L / tan(3.141592653589793238462643383279502884L / n) << "\n";
  }
  return 0;
}
