#include <bits/stdc++.h>
using namespace std;
vector<int> a, k;
int fun(int x) {
  int c = 0;
  for (auto y : a)
    if (y <= x) c++;
  for (auto y : k) {
    if (y > 0 && y <= x) c++;
    if (y < 0 && -y <= c) c--;
  }
  return c;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  srand(time(NULL));
  ;
  int T = 1;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    cout << setprecision(10) << 1 / (2 * sin(3.141592653589793238 / (4 * n)));
    cout << "\n";
  }
  return 0;
}
