#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
const long long INF = 2e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout.precision(10);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    n *= 2;
    ld a = cos(3.14159265 / (2 * n));
    ld b = sin(3.14159265 / n);
    cout << fixed << a / b << "\n";
  }
  return 0;
}
