#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int inf = 1e9;
const int N = 2e5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long double res = 0;
    long double pi = 3.14159265;
    res = 1.0 / (2 * sin(pi / (4.0 * n)));
    cout << setprecision(9) << res << "\n";
  }
  return 0;
}
