#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 2;
const long long INF = 1e17;
const long long Mod = 998244353;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    n *= 2;
    double ang = (n - 2) * acos(-1) / (2 * n);
    cout << fixed << setprecision(10) << tan(ang) << endl;
  }
  return 0;
}
