using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.IO; class Program { static void Main() { new Magatro().Solve(); } } struct S { public bool[] Use; public long Price; public S(long p, bool[] u) { Price = p; Use = u; } } class Magatro { private double[] D = new double[7] { 0, 1.0000000000000000, 1.0833333333333333, 1.2569444444444444, 1.5353009259259260, 1.6915991512345676, 2.0513639724794235 }; private double[] X = new double[7]; private double[] Ans = new double[1000001]; private void Scan() { } private void Calc() { X[1] = D[2] - 1; X[2] = D[3] - X[1] * D[2] - 1; X[3] = D[4] - X[1] * D[3] - X[2] * D[2] - 1; X[4] = D[5] - X[1] * D[4] - X[2] * D[3] - X[3] * D[2] - 1; X[5] = D[6] - X[1] * D[5] - X[2] * D[4] - X[3] * D[3] - X[4] * D[2] - 1; X[6] = 1 - X[1] - X[2] - X[3] - X[4] - X[5]; for (int i = 0; i <= 6; i++) { Ans[i] = D[i]; } for (int i = 7; i <= 1000000; i++) { for (int j = 1; j <= 6; j++) { Ans[i] += Ans[i - j] * X[j]; } Ans[i]++; } } public void Solve() { Scan(); Calc(); StringBuilder sb = new StringBuilder(); int T = int.Parse(Console.ReadLine()); for (int i = 0; i < T; i++) { sb.AppendLine(Ans[int.Parse(Console.ReadLine())].ToString()); } Console.Write(sb.ToString()); } }