#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  double PI = acos(-1.0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    printf("%.9f\n", (cos(PI / (4.0 * n)) / sin(PI / (2.0 * n))));
  }
  return 0;
}
