#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    cout << fixed << setprecision(10)
         << 1.0 / tan(3.14159265358979323846 / (2.0 * n)) << "\n";
  }
  return 0;
}
