#include <bits/stdc++.h>
using namespace std;
int clk[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    double ans;
    if (n == 2)
      ans = 1;
    else {
      double an = 3.14159265358979 / (n * 2.0);
      ans = 1.0 / tan(an);
    }
    cout << fixed << setprecision(10) << ans << "\n";
  }
}
