#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << fixed << setprecision(7) << (cos(PI / (4 * n)) / sin(PI / (2 * n)))
         << endl;
  }
}
