|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||3||2||2||100.000%|
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
3 5 21 40
0.9934260978934218 0.8930267371507457 0.0001461079070016448
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.