#include <bits/stdc++.h>
using namespace std;
void dbg_out() { cerr << "\b\b]\n"; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << H << ", ";
  dbg_out(T...);
}
void solve() {
  long double n;
  cin >> n;
  cout << fixed << setprecision(10);
  if (n == 2) {
    long double ans = 1;
    cout << ans << '\n';
    return;
  }
  n *= 2;
  const double pi = acosl((long double)-1);
  double radian = pi / n;
  double radius = 1.0 / tan(radian);
  cout << radius << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 0;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
