Cody is preparing for a programming competition. He needs k more members for his team to be eligible for the competition. So he organizes a coding test for all his juniors to select the best group. His teacher has instructed him to only select students with consecutive roll numbers. Cody wants to know the total score of the k members selected. Cody is in a hurry and needs your help. You are given the list of marks of N juniors in ascending order of their roll numbers,i.e., the ith number represents the marks of the student with roll no. 'i'. Find k consecutive students with highest total of marks and output the sum of marks of those k students.
The first line contains N, the number of juniors, and k, the number of students needed.
The second line contains N integers separated by space.
Print the highest total among any k consecutive students.
1 ≤ k ≤ n ≤ 10000
-1000 ≤ marks ≤ 1000
Dcoded By: Mrudul Sankhere
Solved By: 497
Maximum Marks: 8