S = [0]*7 S[1],S[2],S[3],S[4],S[5],S[6] = 1/12,2/12,3/12,1/12,3/12,2/12 def solve(): n = int(input()) dp = [0]*(n+6) for i in range(n)[::-1]: count = 0 for j in range(1,7): count += dp[i+j]*S[j] dp[i] = count+1 return dp[0] t = int(input()) for i in range(t): print(solve())