100 atcoder#ABC067B. [ABC067B] Snake Toy
[ABC067B] Snake Toy
Score : points
Problem Statement
Snuke has sticks. The length of the -th stick is .
Snuke is making a snake toy by joining of the sticks together.
The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy.
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
5 3
1 2 3 4 5
12
You can make a toy of length by joining the sticks of lengths , and , which is the maximum possible length.
15 14
50 26 27 21 41 7 42 35 7 5 5 36 39 1 45
386