from functools import cache import sys sys.setrecursionlimit(10 ** 6 + 100) probs = [0, 1/12, 2/12, 3/12, 1/12, 3/12, 2/12] memo = {} def f(x: int) -> float: if x <= 0: return 0 if x in memo: return memo[x] res = 0 for i in range(1, 7): res += (f(x - i) + 1) * probs[i] memo[x] = res return res T = int(input()) for _ in range(T): N = int(input()) ans = f(N) print(ans)