#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long double n;
    cin >> n;
    long double ans = 90 - 360 / (4 * n);
    long double pi = asin(1.0) * 2;
    ans = (ans * pi) / 180;
    cout << setprecision(10) << tan(ans) << endl;
  }
}
