#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int a[] = {1, 2, 3, 1, 2, 3}; int main() { int T; cin >> T; while (T--) { int N; cin >> N; vector dp(N + 1, 1); dp[0] = 0; for (int i = 1; i <= N; i++) for (int j = 1; j <= 6; j++) { int _i = max(0, i - j); dp[i] += dp[_i] * a[j - 1] / 12; } printf("%.10f\n", dp[N]); } }