#include <bits/stdc++.h>
const long long inf = 1 << 28;
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    cout << std::fixed << std::setprecision(9)
         << (cos(3.14159265358979323846 / (4 * n)) /
             sin(3.14159265358979323846 / (2 * n)))
         << endl;
  }
  return 0;
}
