RP = [6,4,12,4,6,12] N = 10**6 E = [0] * (N+1) for i in range(1, N+1): tmp = 0 for j in range(6): tmp += E[i - j - 1] / RP[5-j] tmp += 1 E[i] = tmp T = int(input()) for _ in range(T): N = int(input()) print(E[N])