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