#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (; t > 0; t--) {
    double n, x, y;
    cin >> n;
    x = 1 / (2 * sin(3.14159265358979323846 / (2 * n)));
    y = sin((3.14159265358979323846 / 2) - (3.14159265358979323846 / (4 * n)));
    x = 2 * x * y;
    cout << fixed << setprecision(20) << x << "\n";
  }
  return 0;
}
