|
Koyuki |
Hmm... |
|
Koyuki |
Hmmm... |
|
Koyuki |
Ah! I've got it all figured out! Let's give it another spin! |
|
Koyuki |
<Beeep— It's !> Gah! |
|
Koyuki |
Grrr... Why did it happen again!? |
The first line contains .
The second line contains , separated by spaces. Here, is the integer initially displayed in the -th round.
Print the maximum expected total score Koyuki can achieve. An absolute or relative error of at most is allowed. Under the given constraints, no strategy can make the value grow without bound.
|
Maki |
Wow, talk about bad luck. How many times in a row have you landed on the lowest number now? |
|
Kotama |
That makes five in a row. Even a rough calculation puts the odds at about the chance of being struck by lightning in a year. |
|
Hare |
At this point, I can only assume the god of prime factorization has cursed you. |
|
Koyuki |
What kind of god is that!? Anyone can see there's something wrong here! |
|
Koyuki |
This is definitely rigged! Someone must have modified the roulette to mess with me— |
|
Hare |
Sorry, but this roulette is working just fine. |
|
Koyuki |
Then at least show me the logic behind it! There has to be something wrong! |
Hmm, let's see... Oh, so this roulette runs on prime numbers? Here's roughly how it works.
In each round, I start with an integer .
Once a round begins, I can choose one of two actions on each turn.
If I spin the roulette, changes according to prime numbers. Specifically—
If is prime, it becomes .
If is not prime, it becomes one of the prime divisors of ... The probability of each prime being selected is proportional to its multiplicity in the prime factorization of .
After all rounds are over, the points earned in each round are added together to get the final score.
There are rounds in total, and I know the starting value of in each round... So if I play the roulette in a way that maximizes my expected score, winning this game is as good as guaranteed! Nihahaha~