def main(): try: import pypyjit pypyjit.set_param('max_unroll_recursion=-1') except: pass try: import sys sys.setrecursionlimit(10**7) except: pass from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum from heapq import heapify, heappop, heappush from bisect import bisect_left, bisect_right from copy import deepcopy import copy import random from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_,itemgetter INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython ''' クエリO(1)にしよう 確率等しいとは限らないのやばすぎだろ あーーーーーー 推測させるのかw なるほど 2個めはそのままp1の確率 ''' p = [12,6,4,12,4,6] for _ in range(int(input())): N = int(input()) dp = [0]*(N+7) for i in reversed(range(N)): for j in range(1,7): dp[i] += (dp[i+j]+1)/p[j-1] print(dp[0]) if __name__ == '__main__': main()