#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using pll = pair<ll, ll>;
const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;
int main() {
  ll tst;
  cin >> tst;
  while (tst--) {
    ll n;
    cin >> n;
    double ans;
    double theta = ((360 * 1.0) / (2 * n));
    theta = theta * 1.0 / 2.0;
    theta = theta * 3.141592653589793238 / 180;
    if (n % 2 == 0) {
      ans = cos(theta) / sin(theta);
    } else {
      ans = (1 * 1.0) / sin(theta);
    }
    cout << setprecision(12) << ans << endl;
  }
}
