#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    printf("%.7f\n", tan((3.141592653589793238462643 / 2) * (1.0 - 1.0 / n)));
  }
  return 0;
}
