#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
double solve(int n) { return 1 / (2 * sin(pi / 4 / n)); }
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    printf("%.10lf\n", solve(n));
  }
}
