Ysolde inherited the gallery at the fen lights of Will-o-Wisp along with its curious bookkeeping system for segments. Time to make sense of it. Task: Print the maximum sum of any contiguous subarray of length exactly k. Input format: First line: n and k. Second line: n integers. Output format: Print the maximum window sum. Constraints: 1 <= k <= n <= 2254; -1000000 <= a[i] <= 1000000.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= k <= n <= 2254; -1000000 <= a[i] <= 1000000.
