#include <bits/stdc++.h>
using namespace std;
long long t;
long long n;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    long double ans = (long double)1 / sin((long double)acos(-1.0) / (2 * n));
    ans *= (long double)cos((long double)acos(-1.0) / (4 * n));
    cout << fixed << setprecision(10) << ans << endl;
  }
  return 0;
}
