#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL);
  cout.precision(15);
  cout << fixed;
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    n *= 2;
    double ans = (1 / (tan(3.14159265 / n)));
    cout << ans << "\n";
  }
}
