#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
#define double long double
int n, t;
const int N = 1e5 + 5;
double f[N], res;
double get(int a, int b)
{
return exp((f[b] - f[a] - f[b - a]) - log(2) * (b + 1));
}
int main()
{
for (int i = 1; i <= 50000; i++)
f[i] = f[i - 1] + log(i);
cin >> t;
while (t--)
{
cin >> n, n >>= 1, res = 0.0;
for (int j = 0; j <= n - 2; j++)
res += get(j, j + n - 1);
cout << fixed << setprecision(4) << 2.0 * res << "\n";
}
}
对着100000测了25组,算编译时间才300ms,这时限3s咋还T了呢