#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const double pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    double r;
    double n;
    cin >> n;
    r = 1.0 / tan(pi / (2.0 * n));
    cout << setprecision(6) << fixed;
    cout << r << '\n';
  }
  exit(0);
}
