Maximum Window Sum


Given an array aa of length nn and an integer kk, find the maximum possible sum of a contiguous subarray of length exactly kk.

Remember that a subarray is a contiguous section of the array.

Input

The first line contains two integers nn and kk.

The second line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n.

Output

Print a single integer: the maximum sum of any contiguous subarray of length exactly kk.

Constraints

  • 1≤k≤n≤1051 \le k \le n \le 10^5
  • −103≤ai≤103-10^3 \le a_i \le 10^3

Example 1

Input 1
5 3
1 -2 3 -4 5
Output 1
4
Explanation

The length-33 subarrays have sums 22, −3-3, and 44, so the answer is 44.

Example 2

Input 2
8 3
-512 750 27 -532 -940 781 -449 278
Output 2
610

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.