#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos((long double)-1.0);
const double EPS = 1e-8;
const int MOD = 1e9 + 7;
template <typename T>
void cmin(T& x, T y) {
  if (y < x) x = y;
}
template <typename T>
void cmax(T& x, T y) {
  if (y > x) x = y;
}
long long qpow(long long x, long long n, long long mod = MOD) {
  if (n < 0) return 0;
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}
long long sq(long long x) { return x * x; }
double sq(double x) { return x * x; }
struct Vector {
  double x, y;
  Vector() {}
  Vector(double x, double y) : x(x), y(y) {}
  double length() { return sqrt(x * x + y * y); }
  Vector operator+(const Vector& v) const { return Vector(x + v.x, y + v.y); }
  Vector operator-(const Vector& v) const { return Vector(x - v.x, y - v.y); }
  Vector operator*(const double& k) const { return Vector(k * x, k * y); }
  Vector operator/(const double& k) const { return Vector(x / k, y / k); }
  Vector rotate(double k) {
    return Vector(x * cos(k) - y * sin(k), x * sin(k) + y * cos(k));
  }
  void show() { printf("%.12f %.12f\n", x, y); }
};
namespace Solver {
void InitOnce() {
  int t;
  scanf("%d", &t);
}
int n;
void Read() {
  int res = scanf("%d", &n);
  if (res == -1) exit(0);
}
double a, r;
double Build(double d) {
  Vector v1(r, 0.0);
  v1 = v1.rotate(d);
  double x1, x2, y1, y2;
  x1 = LINF, x2 = -LINF;
  y1 = LINF, y2 = -LINF;
  for (int i = 1; i <= n; ++i) {
    cmin(x1, v1.x);
    cmin(y1, v1.y);
    cmax(x2, v1.x);
    cmax(y2, v1.y);
    v1 = v1.rotate(a);
  }
  double ans = max(x2 - x1, y2 - y1);
  return ans;
}
double RandDouble() { return 1.0 * rand() / RAND_MAX; }
void Solve() {
  n *= 2;
  a = 2.0 * PI / n;
  r = (0.5) / (sin(a / 2.0));
  double L = 0, R = a;
  for (int t = 600; t; --t) {
    double M1 = L + 1.0 * (R - L) / 3.0;
    double M2 = L + 2.0 * (R - L) / 3.0;
    double ans1 = Build(M1);
    double ans2 = Build(M2);
    if (ans1 < ans2)
      R = M2;
    else
      L = M1;
  }
  double ans = Build((L + R) / 2.0);
  printf("%.12f\n", ans);
  return;
}
}  // namespace Solver
int main() {
  Solver::InitOnce();
  while (1) {
    Solver::Read();
    Solver::Solve();
  }
  return 0;
}
