#include <bits/stdc++.h>
using namespace std;
void print_vector(vector<long long> a) {
  for (long long i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
}
void print_set(set<long long> a) {
  set<long long>::iterator itr;
  for (itr = a.begin(); itr != a.end(); itr++) cout << *itr << " ";
  cout << endl;
}
void print_array(long long* a, int n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long p = power(x, y / 2) % 998244353;
  p = (p * p) % 998244353;
  return (y % 2 == 0) ? p : (x * p) % 998244353;
}
long long fact(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) res = res * i, res = res % 998244353;
  return res;
}
long long ncr(long long n, long long r) {
  return fact(n) / (fact(r) * fact(n - r));
}
long long fib(long long a) {
  if (a == 0) return 1;
  vector<long long> l(a);
  if (a == 1)
    return 2;
  else if (a == 2)
    return 3;
  else {
    l[0] = 2;
    l[1] = 3;
    for (long long i = 2; i < a; i++) {
      l[i] = (l[i - 1] % 998244353) + (l[i - 2] % 998244353);
    }
  }
  long long ans = (l[a - 1] % 998244353);
  return ans;
}
long long min(long long a, long long b) {
  if (a >= b)
    return b;
  else
    return a;
}
long long max(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
double polyapothem(double n, double a) {
  if (a < 0 && n < 0) return -1;
  long long t = (n - 4) / 2;
  long long one = t / 2;
  long long two = t - one;
  double x;
  x = (double)a / (2 * sin(((double)180 / n) * 3.14159265 / 180));
  double teta = ((double)180 / n) * (one + 1);
  double d;
  d = (2 * x) * sin(teta * 3.14159265 / 180);
  double b = d / 1.41421356237;
  teta = ((double)180 / n) * (two + 1);
  d = (2 * x) * sin(teta * 3.14159265 / 180);
  double c = d / 1.41421356237;
  return (b + c);
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  std::cout << std::setprecision(6);
  while (t--) {
    long long n;
    cin >> n;
    double ans = polyapothem(2 * n, 1);
    printf("%.10f\n", ans);
  }
  return 0;
}
