#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
double q, n;
int main() {
  cin >> q;
  while (q--) {
    cin >> n;
    printf("%.8lf\n", 1.0 / tan(PI / 2 / n));
  }
  return 0;
}
