#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    float n;
    cin >> n;
    cout << fixed << setprecision(9)
         << cos(3.141592653589 / (4 * n)) / sin(3.141592653589 / (2 * n))
         << endl;
  }
}
