#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, N;
    cin >> n;
    N = 2 * n;
    long double ri, rc, ans, d;
    ri = (long double)(1 /
                       (long double)(2 *
                                     tan((long double)3.1415926535897932 / N)));
    rc = (long double)(1 /
                       (long double)(2 *
                                     sin((long double)3.1415926535897932 / N)));
    if (n % 2 == 0) {
      cout << setprecision(10) << 2 * ri;
      cout << "\n";
    } else {
      cout << setprecision(10)
           << cos((long double)3.1415926535897932 / (2 * N)) /
                  sin((long double)3.1415926535897932 / N);
      cout << "\n";
    }
  }
  return 0;
}
