#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    double n;
    cin >> n;
    double s = 2.0 * n;
    double pi = acos(-1.0);
    double angle = pi / s;
    double half = 1.0 / (2.0 * tan(angle));
    double ans = 2.0 * half;
    printf("%f\n", ans);
  }
  return 0;
}
