#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    double tmp_angle = 0;
    double angle_increment = pi - (2 * n - 2) * pi / (2 * n);
    double ans = 0;
    for (int i = 0; i < n; i++) {
      tmp_angle += angle_increment;
      ans += sin(tmp_angle);
    }
    printf("%.9lf\n", ans);
  }
  return 0;
}
