import sys sys.setrecursionlimit(10 ** 6) def II(): return int(sys.stdin.readline()) def main(): for x in range(II()): k = II() if k>1000: print(k+4/3) continue dp = [0] * (k + 1) loop = 30 l = 0 r = k + 6 for _ in range(loop): m=(l+r)/2 dp[0]=m for i in range(k - 1, -1, -1): dp[i] = sum(dp[i + j] if i + j <= k else dp[0] for j in range(1, 7)) / 6 + 1 if dp[0]>m:l=m else:r=m print(m) main()