#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
long double pi = 3.141592653589793238;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    long double ans;
    long double n = 2.0000000000000 * (long double)x;
    long double angle =
        (180.000000000000000 - 360.00000000000000 / n) / 2.00000000000000;
    angle = angle * pi / 180.000000000000;
    long double side = (long double)0.500000000000 / (long double)cosl(angle);
    if (x % 2 != 0) {
      ans = (long double)2.000000000 * side;
    } else {
      side = side * (long double)sinl(angle);
      ans = (long double)2.000000000 * side;
    }
    cout << to_string(ans) << "\n";
  }
}
