Birthday - MarisaOJ: Marisa Online Judge

Birthday

Time limit: 1000 ms
Memory limit: 256 MB
Today is your birthday and you invite $k$ friends. You have $n$ squared cakes and they all have the height $1$. The $i^{th}$ cake have an edge length of $A_i$. Now you want to cut these cakes in such a way that each friend has the same amount of cake, and each piece of cake must be cut from **at most** 1 cake (i.e. you can't cut a a piece of cake of size $a$ from cake $A$ and a piece of size $b$ from cake $B$ to make a piece of size $a + b$). Find the maximum cake size your friends will receive. ### Input - The first line contains 2 integers $n, k$. - The second line contains $n$ integers $A_i$. ### Output - Print the maximum size. Your answer will be considered correct if its absolute or relative error does not exceed $10^{-3}$. In other words, your answer, $x$, will be compared to the correct answer, $y$. If $|x-y| < 10^{-3}$, then your answer will be considered correct. ### Constraints - $1 \le n, A_i \le 10^5$. - $1 \le k \le 10^9$. ### Example Input: ``` 2 5 4 5 ``` Output: ``` 8.000 ```