#include <bits/stdc++.h>
using namespace std;
int t, n;
long double ang, ca, PI = acos(-1);
int main() {
  ;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> t;
  while (t--) {
    cin >> n;
    ang = 2 * PI / (2 * n);
    ca = 0.5 / tan(ang / 2);
    cout << fixed << setprecision(10) << 2 * ca << '\n';
  }
  return 0;
}
