#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Statement

As some of his students are not eating their fruits, Rabbit had to bring them home. Thus, he now has *N* bananas.

Rabbit likes banana smoothies. Thus, he has decided to make them into banana smoothies. It takes *K* bananas to make a banana smoothie.

Bananas have different quality, which affect the banana smoothie. Each banana has quality *Q _{i}*, and as Rabbit has very sensitive taste buds, the quality of a smoothie is given by the minimum quality of all bananas used to make the smoothie.

Rabbit wants to make some smoothies such that the sum of their quality is maximised. Help him find the maximum sum of the quality of the smoothies!

## Input

The first line of input contains two integers, *N* and *K*.

The next line of input contains *N* integers, representing the array *Q*.

## Output

The first and only line of output should contain a single integer denoting the maximum sum of the quality of the smoothies.

## Limits

For all subtasks, 1 ≤ *K* ≤ *N* ≤ 100000 and -10^{9} ≤ *Q _{i}* ≤ 10

^{9}.

Subtask 1 (10%): *K* = 1

Subtask 2 (30%): 0 ≤ *Q _{i}*

Subtask 3 (60%): There are no more constraints.

## Sample Input

8 3 9 2 3 4 2 3 -1 6

## Sample Output

6

## Explanation

We can make a smoothie using bananas 1, 4 and 8 (1-indexed) with quality 4 and another smoothie using bananas 2, 3 and 5 with quality 2. This adds up to 6, which is the maximum possible.### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 10 | 12 | 1s | 256MB | Minimum |

2 | 30 | 9 | 1s | 256MB | Minimum |

3 | 60 | 35 | 1s | 256MB | Minimum |

4 | 0 | 1 | 1s | 256MB | Minimum |

### Judge Compile Command

g++-7 ans.cpp -o bananasmoothie -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512