#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double x = n;
    x = M_PI_2 / x;
    double ans = sin((n / 2) * x + M_PI_4) / sin(x);
    printf("%0.9lf\n", ans);
  }
}
