#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int i;
  int test, n;
  cin >> test;
  while (test--) {
    cin >> n;
    n = 2 * n;
    if (n == 4) {
      printf("%.9lf\n", 1.0);
    } else {
      double half_interior_angle =
          3.141592653589793238462643 * (n - 2) / (2 * n);
      double rotation = 3.141592653589793238462643 / n;
      printf("%.9lf\n", cos(rotation) / cos(half_interior_angle));
    }
  }
  return 0;
}
