#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846264338327950288419716939937510582;
int t;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    cout << fixed << setprecision(20) << cos(PI / (4 * n)) / sin(PI / (2 * n))
         << "\n";
  }
  return 0;
}
