#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long double ans =
        cos(3.14159265359 / (4.0 * n)) / sin(3.14159265359 / (2.0 * n));
    cout << fixed << setprecision(10) << ans << '\n';
  }
  return 0;
}
