In the game Pickomino (also known in the Netherlands as Regenwormen) you must roll 8 dice to reach at least a given target score. The rules are as follows.
Jan is playing and wants to score at least $n$ points. Using an optimal strategy, what is the probability that Jan reaches this target?
The first line contains one positive integer: the number of test cases (at most 100).
Each of the following test cases consists of one line with the integer $n$ ($1 \le n \le 40$): the target score.
For each test case, print one line with the probability of scoring at least $n$ points under an optimal strategy, rounded to exactly 10 decimal places.
To reach 5 points it is enough to roll at least one worm, so the optimal strategy is to stop as soon as you have a worm. If you did not roll a worm, you should set aside as few dice as possible to maximize the chance of rolling a worm on a later roll.