Max Sum of K elements
Write a program that reads two integer numbers N and K and an array of N elements from the console. Find the maximal sum of K elements in the array.
- On the first line you will receive the number N
- On the second line you will receive the number K
- On the next N lines the numbers of the array will be given
- Print the maximal sum of K elements in the array
- 1 <= N <= 1024
- 1 <= K <= N