시간 제한
메모리 제한
In the game Pickomino1 one has to throw 8 dice to reach at least a certain target score. The rules are as follows:
Jan is playing Pickomino and wants to score at least n points. When Jan uses an optimal strategy, what is the probability that he reaches this target?
1Dutch people may know this game as Regenwormen
On the first line one positive number: the number of test cases, at most 100. After that per test case:
one line with the integer n (1 ≤ n ≤ 40): the target value.
Per test case:
This number should be accurate up to 10-6 relative or absolute precision
To reach 5 points it is enough to throw at least one worm. The optimal strategy in this case is therefore to stop as soon as you have a worm. If you did not throw a worm, you should put aside as few dice as possible to maximize the chance of throwing a worm in a later throw.