#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    double n;
    cin >> n;
    double up = cos(3.14159265358979323846 / (4.0 * n));
    double down = sin(3.14159265358979323846 / (2.0 * n));
    double ans = up / down;
    cout << setprecision(10) << ans << endl;
  }
}
