#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ll t;
  cin >> t;
  cout << fixed;
  while (t--) {
    ll s;
    cin >> s;
    ll n = 2 * s;
    cout << 1 / sin(3.14159265 / n) * cos(3.14159265 / 2 / n) << '\n';
  }
  return 0;
}
