#include <bits/stdc++.h>
using namespace std;
double ang(double x) { return x * 3.14159265 / 180; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    double n;
    cin >> n;
    double r = 1 / (2 * sin(ang(90 / n)));
    double x = r * sin(ang(90 / n));
    double t = 1 / (2 * tan(ang(90 / n)));
    cout << fixed << setprecision(6) << 2 * (t - x) + 1 << endl;
  }
  return 0;
}
