#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = pi / 180.0;
int main() {
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    double angle = 180.0 / n;
    double first = 1.0 / 2.0 / sin(angle / 2.0 * eps);
    double a1 = 180.0 / n * round(n / 4.0);
    double a2 = 90 - a1;
    double ans = first * (sin(a1 * eps) + sin(a2 * eps)) / sin(45.0 * eps);
    printf("%.9lf\n", ans);
  }
  return 0;
}
