#include <bits/stdc++.h>
using namespace std;
long long t, n;
long double PI = 3.14159265;
int32_t main() {
  cin >> t;
  while (t--) {
    cin >> n;
    cout << setprecision(10) << (cos(PI / (4.0 * n)) / sin(PI / (2.0 * n)))
         << endl;
  }
}
