#include <bits/stdc++.h>
using namespace std;
int main() {
  long double i, j, k, n, t, l, r, m = 0, a, b, c, d;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n == 2) {
      cout << "1" << endl;
      continue;
    }
    k = double(cos(double(3.14159 / (2 * n)))) /
        double(sin(double(3.14159 / (2 * n))));
    cout << fixed << setprecision(20) << k << endl;
  }
}
