#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    double x = (double)3.14159265359 / (2 * n);
    double ans = 1 / tan(x);
    printf("%.8f\n", ans);
  }
  return 0;
}
