#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    n *= 2;
    float theta = (float)180 / n;
    float den = sin(theta * 3.141592653 / 180);
    den = 1 / den;
    int i = 1;
    float ang;
    ang = 3 * (float)90 / n;
    ang = 90 + theta - ang;
    float num = sin(ang * 3.141592653 / 180);
    printf("%0.9f\n", num * den);
  }
}
