HardPrefix Sums2000 ms256 MB
Scholarship Window
Given daily practice minutes and a window size `k`, find the maximum total practice minutes over any consecutive `k` days.
Statement
Given daily practice minutes and a window size `k`, find the maximum total practice minutes over any consecutive `k` days.
Input
First line: `n k`. Second line: `n` integers.
Output
Print the maximum window sum.
Constraints
- `1 <= k <= n <= 100000`
Examples
Example 1
Input
6 3
20 30 25 10 40 15Output
75The first three days total 75, which is the maximum.
Sample runs use visible examples. Full submissions are checked securely on the server, and private test cases are not shown in the browser.