#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    double r = 1 / (2 * tan((360 / (4 * n)) * (3.1415926535 / 180)));
    cout << setprecision(15) << 2 * r << endl;
  }
}
