#include <bits/stdc++.h>
using namespace std;
bool comp(int x, int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    cout << fixed << setprecision(9)
         << cos(3.1415926535 / (4 * n)) / sin(3.1415926535 / (2 * n)) << '\n';
  }
}
