#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double pi = 3.14159265358979323846;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    double x = pi / n;
    double r = ((1.0 / 2.0) * 1.0) * (1.0 / tan(x));
    double R = cos(pi / (4.0 * n)) / sin(pi / (2.0 * n));
    double dif = R + R - r - r;
    dif /= 4.0;
    cout << setprecision(12) << R << endl;
  }
}
