#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const double PI = 3.141592653589793238463;
const int INF = 0x3f3f3f3f;
const int INFS = 1000000000;
const long long LLINF = 9223372036854775807;
const int M = 1000000007;
const int HM = 1000000009;
const int HP = 43;
const double EPS = 1e-8;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long double n;
    cin >> n;
    long double ans = (1 / sin(2 * PI / (2 * 2 * 2 * n))) / 2;
    cout << setprecision(20) << ans << "\n";
  }
  return 0;
}
