#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    long double theta = 3.14159265358979323846 / (2 * n);
    long double answer = 1 / tan(theta);
    cout << setprecision(15) << answer << '\n';
  }
  return 0;
}
