#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return (b == 0 ? a : gcd(b, a % b));
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return (a * (b / gcd(a, b)));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    double ans = 1.0 / sin(1.0l * acos(-1) / (2 * n)) *
                 sin(1.0l * acos(-1) / 4 + (n / 2) * 1.0l * acos(-1) / (2 * n));
    cout << fixed << setprecision(10) << ans << endl;
  }
  return 0;
}
