#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  double pi = acos(-1);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    long long L = 1;
    double rad = L / (2.00 * sin(pi / 180.00 * (180.000 / (2.00 * n))));
    double x = rad * rad - 0.500 * 0.500;
    x = 2.00 * sqrt(x);
    cout << fixed << setprecision(8) << x << endl;
  }
}
