#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    double n, ans;
    cin >> n;
    double val = (90.0) / n;
    val = (val * 3.14159265) / 180.0;
    ans = (1 / (sin(val))) * (cos(val / 2.0));
    cout << fixed << setprecision(8) << ans << endl;
  }
  return 0;
}
