#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 * 1000 + 1;
const double pi = acos(-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    n *= 2;
    double edge_length = 1.0 / (2.0 * sin(pi / n));
    cout << fixed << setprecision(7)
         << sqrt(edge_length * edge_length - 0.25) * 2 << "\n";
  }
  return 0;
}
