#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long double pi = 3.141592653;
  int t;
  cin >> t;
  while (t--) {
    long double n;
    cin >> n;
    long double angle = 180 - 360 / (2 * n);
    angle = angle / 2;
    angle = angle * (pi / 180);
    long double ans = tan(angle);
    cout << fixed << setprecision(7) << ans << endl;
  }
}
