#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long double tt;
  cin >> tt;
  while (tt--) {
    long double n;
    cin >> n;
    long double ans;
    ans = (long double)(cos((long double)pi / (4 * n)));
    ans = (long double)ans / (sin((long double)pi / (2 * n)));
    cout << fixed << setprecision(10) << ans << endl;
  }
  return 0;
}
