#include <bits/stdc++.h>
using namespace std;
const int mx = 1000011;
const long long mod = 1e9 + 7;
string s;
int n, q;
int tree[mx];
void update(int x, int val) {
  while (x <= n) {
    tree[x] += val;
    x += (x & -x);
  }
}
int query(int x) {
  int sum = 0;
  while (x > 0) {
    sum += tree[x];
    x -= (x & -x);
  }
  return sum;
}
void solve() {
  int n;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl;
    return;
  }
  n = 2 * n;
  double angle = (n - 2) * 1.0 * 180.0;
  angle = angle / (n * 1.0);
  angle -= 90.0;
  double pi = acos(-1.0) / 180.0;
  double last = 0.0;
  double ans = 0;
  for (int i = 0; i < (n - 4) / 4; i++) {
    double angles = angle - last;
    ans += 2.0 * sin(angles * pi);
    last = 90.0 - (angle - last);
  }
  ans += 1.0;
  cout << setprecision(14) << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
