#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
void amfetamin() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
}
int main() {
  amfetamin();
  int t;
  cin >> t;
  cout << fixed;
  cout << setprecision(8);
  while (t--) {
    double n;
    cin >> n;
    n += n;
    double alph = (double)360 / (double(2) * n);
    double rad = alph * 3.1415926535 / 180;
    double k = 1 / sin(rad);
    double r = k;
    double sol = cos(rad / double(2)) * r;
    cout << sol << "\n";
  }
}
