Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.
Shenyang's night fair culture is developed very well. Every time Bob comes to Shenyang, he will definitely go to a night fair called The Witchwood. There are $$$n$$$ snack stalls in The Witchwood, the $$$i$$$th of which gives him $$$a_i$$$ pleasure.
Bob's stomach allows him to eat $$$k$$$ snack stalls at most. So Bob wants to know the maximum pleasure he can get after visiting the night market.
Input
The first line of input contains two integers $$$n$$$ $$$(1 \le n \le 1000)$$$ and $$$k$$$ $$$(1\le k \le n)$$$, indicating the number of snack stalls and the capacity of Bob's stomach.
The second line of input contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ $$$(1\leq a_i \leq 10^9)$$$, the $$$i$$$th of which indicates the pleasure of the $$$i$$$th snack stall.
Output
Print one integer denoting the maximum pleasure Bob can get.