dp=[0]*1000001 p = [1/12, 2/12, 3/12, 1/12, 3/12, 2/12] dp[0] = 0 for i in range(1, 1000001): for j in range(1, 7, 1): dp[i] += (dp[i-j]*p[j-1]) dp[i] += 1 T=int(input()) for _ in range(T): n = int(input()) print(u"{0:f}".format(dp[n]))