A: Meditation
题号:NC220696
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Luna had a stressful day and she wants to do a meditation routine that relaxes her well. Luna's routines are more or less relaxing and to determine how relaxing a routine is, Luna computes its score: the higher the score, the more relaxing it is!
Luna has graded each of the exercises with a positive integer and the score of a routine is simply the sum of the grades of its individual exercises. She gives you her list of graded exercises and asks you what is the maximal grade of a routine composed of  different exercises.

输入描述:

The first line of the input contains two space-separated integers: and .
The  following lines each contain a single integer, the  line containing the grade  of the -th exercise.

输出描述:

The output should contain a single line with a single integer: the maximal score of a routine composed of  different exercises.
示例1

输入

复制
5 3
10
22
7
3
10

输出

复制
42

说明

We select the exercises 1, 2 and 5 which gives a total score of .

备注: