#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
double n, t, k;
string s;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    n *= 2.0;
    double ct = 360.0 / n / 2;
    ct = ct / 180.0 * 3.1415926535;
    ct = 1 / sin(ct);
    printf("%.10lf\n", ct * cos(3.1415926535 / n / 2));
  }
  return 0;
}
