eolymp
bolt
Try our new interface for solving problems
Problems

K-th Gutab

K-th Gutab

In ADA University, $n$ kinds of gutab are sold. Gutab of the $i$-th kind is sold for $a_i$ qəpik. \textbf{Gutab} is an Azerbaijani dish made from thinly rolled dough that is cooked briefly on a convex griddle known as a saj. There are many variations of qutab: usually, pumpkin and greens are used as fillings. There are also Shamakhy qutab, Yashyl Qutab and Qarın qutabı, quzu qutabı (lamb), deve qutabi specific for Jorat settlement. They are regional variations of qutab in Azerbaijan. Huseyn will buy at least one gutab in total. He is allowed to buy multiple gutabs of the same kind. Find the $k$-th lowest price that Huseyn may pay. Here, if there are multiple sets of gutabs that cost the same price, the price is counted only once. \InputFile The first line contains two numbers: $n\:(1 \le n \le 10)$ and $k\:(1 \le k \le 2 \cdot 10^5)$. The second line contains the prices for different kinds of gutabs: $a_1, a_2, ..., a_n\:(1 \le a_i \le 10^9)$. \OutputFile Print the $k$-th lowest price that Huseyn may pay. \Examples The six lowest prices that Huseyn may pay are \begin{itemize} \item 5 qəpik \item 10 qəpik \item 11 qəpik \item 15 qəpik \item 11 + 5 = 16 qəpik \item 20 qəpik \end{itemize} Thus, the answer is $20$.
Time limit 1 second
Memory limit 128 MiB
Input example #1
5 6
5 10 11 15 20
Output example #1
20