#include <bits/stdc++.h>
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
const long long MOD2 = 998244353;
const long double PI = 3.141592653589793;
using namespace std;
double findRadiusOfcircumcircle(double n, double a) {
  if (n < 0 || a < 0) return -1;
  double radius = a / sqrt(2 - (2 * cos(2 * PI / n)));
  return radius;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    n *= 2;
    double r = findRadiusOfcircumcircle(n, 1);
    double deg = 360 / (2 * n);
    deg = (PI / 180) * deg;
    double ans = 2 * r * cos(deg);
    cout << setprecision(20) << ans << endl;
  }
}
