#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline", "-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
using namespace std;
using ll = long long;
const int N = 2e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    n *= 2;
    double ans = 0, k, fk;
    k = 180.0 * (n - 2) / n;
    fk = 180.0 - k;
    for (int i = 2; i <= (n >> 2); ++i) {
      ans += sin((k - 90) * 3.14159265 / 180.0);
      k -= fk;
    }
    printf("%.9f\n", ans * 2 + 1);
  }
  return 0;
}
