#include <bits/stdc++.h>
using namespace std;
inline void FASTIO() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
const int MAXN = 2E5 + 5;
int a[MAXN];
void solve() {
  int n;
  cin >> n;
  cout << 1 / tan((long double)M_PI / 2 / n) << '\n';
}
signed main() {
  FASTIO();
  cout << fixed << setprecision(6);
  int t;
  cin >> t;
  while (t--) solve();
}
