#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    n = 2 * n;
    double deg = 2 * acos(0.0) / n;
    double ans = cos(deg / 2) / sin(deg);
    cout << fixed << setprecision(9) << ans << endl;
  }
}
