LearnPy Hub
← Arena
EasyRating 1000

Best Window of K

Print the maximum sum of k consecutive elements.

Input

n k, then n integers.

Output

A number.

Sample 1

Input
5 2
1 4 2 10 2
Output
12

Sample 2

Input
1 1
-3
Output
-3
solution.py
Output appears here
Best Window of K · Python Arena problem · LearnPy Hub