#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  const long double pi = 2.0l * acosl(0.0l);
  cin >> t;
  while (t-- != 0) {
    int n;
    cin >> n;
    long double n2 = (long double)(n);
    long double d = (180.0l / n2);
    long double ans = 0.0l;
    for (int i = (-n / 2); i <= n / 2; i++) {
      long double x = ((long double)(i)*d + (d / 4.0l)) * pi / 180.0l;
      ans = ans + cosl(x);
    }
    cout << fixed << setprecision(12) << ans << endl;
  }
  return 0;
}
