#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    const double pi = 3.14159265358979323846;
    long double angle = (pi / (n));
    int number = (n - 2) / 2;
    long double val = 0;
    for (int i = 1; i <= number; i++) {
      val += cos(angle * i);
    }
    long double out = (2 * val) + 1;
    cout << setprecision(20) << out << endl;
  }
  return 0;
}
