#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    cout << setprecision(10) << ::fixed
         << cos(3.14159265358979323846 / (4 * n)) /
                sin(3.14159265358979323846 / (2 * n))
         << "\n";
  }
}
