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