#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int nmax = 200011, mod = 1e9 + 7, inf = 2000010000;
void solve() {
  int n;
  cin >> n;
  long double ans = tan(((90 - 180.0 / (2 * n)) * acos(-1) / 180));
  cout << fixed << setprecision(10) << ans << "\n";
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
