#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  srand(time(NULL));
  ;
  int T = 1;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    cout << setprecision(10)
         << cos(3.141592653589793238 / (4 * n)) /
                sin(3.141592653589793238 / (2 * n));
    cout << "\n";
  }
  return 0;
}
