MAX = 1000005 dp = [0.0] * MAX p = [1 / 12, 2 / 12, 3 / 12, 1 / 12, 3 / 12, 2/ 12] for i in range(1, MAX): for j in range(1, (min(6, i - 1)) + 1): dp[i] += dp[i - j] * p[j - 1] dp[i] += 1 T = int(input()) for i in range(T): N = int(input()) print(dp[N])