Day 21 Coding Mock (1)
Day 21 Coding Mock (1)
Input Format:
The first line contains an integer N, the number of
cards.
The second line contains N space-separated integers
representing the points on each card.
The third line contains an integer K, the number of
cards you must pick.
Output Format:
Print the maximum score that can be achieved by
picking exactly K cards optimally.
Input :
7
1234561
3
Output :
12