Hide

Problem A
Climbing Capacity

Agnar loves ascending mountains. He has planned a route that consists of $N$ legs that must be completed in order. He starts each day fully rested, but each leg makes him more tired that day. Agnar tolerates a certain level of tiredness from all the legs he completes on a certain day. The interesting thing is that the level of tiredness he experiences in a day is the product of how tiresome every individual leg completed that day is! Given $M$, the number of days Agnar has to complete the hike, figure out the highest level of tiredness Agnar will be if he tries to minimize how tired he is on the most tiresome day, if he strategically chooses how many consecutive legs to complete each day.

Input

The first line contains the number $N$, which describes the number of legs the complete hike consists of, and the number $M$, which is the number of days Agnar can use to complete the hike. The next line contains the $N$ integers $T_1$ to $T_ N$, which is the level of tiredness associated with each leg.

Output

The tiredness level from the most tiresome day can grow very large, therefore it is sufficient to output the decimal number $E$, which is the number such that $10^ E$ is equal to the tiredness level. Your answer must have an absolute or relative error of at most $10^{-6}$.

Limits

  • $1 \leq N \leq 100\, 000$

  • $1 \leq M \leq N$

  • $1 \leq T_ i \leq 100$

Sample Input 1 Sample Output 1
4 2
2 3 2 2
0.77815125

Please log in to submit a solution to this problem

Log in