Problem A
Genius

If someone were to make a prediction that everyone thought was doomed to failure, and it turned out to be correct, wouldn’t it be shortsighted simply to dismiss this as a stroke of luck? What if the person could do so over and over again? Instead of explaining away those capable of such prognostications, society has labelled them ‘geniuses’, and has accepted that mere mortals are simply unable to comprehend their godlike level of reasoning, reasoning that transcends common sense.
Jimmy is not a genius, but he would like to fool people into
thinking he is one so that he can use this rarefied title on
his resume and land his dream job. He has come up with a
strategy that he claims will correctly predict at least
A tournament involves
Jimmy’s strategy for determining tournament winners is taken
from an exercise in a number theory book he idly flipped
through in the library one day. First he chooses distinct prime
numbers
Input
The first line of input contains five space-separated
integers,
Output
Output a single floating-point number: the probability that
Jimmy is perceived as a genius by the general public and
therefore be able to get his dream job — in other words,
the probability that Jimmy’s strategy correctly predicts the
winner of at least
Sample Input 1 | Sample Output 1 |
---|---|
2 4 7 13 5 1 2 3 4 4 3 2 1 2 2 2 2 4 6 3 5 |
0.2473950797 |