A ledger records n integer daily balance CHANGES (each can be positive, negative, or zero). For a fixed window length k, consider every contiguous window of k consecutive days. In each window, find the FIRST (leftmost) daily change that is STRICTLY NEGATIVE within that window; call this the window's "first deficit". If a window has no negative entries at all, its first deficit counts as 0.
Print the SUM, over all windows, of their first deficits.
Input format
Line 1: two integers n and k.
Line 2: n space-separated integers, the daily changes.
Output format
A single integer: the sum described above.
Constraints
- 1 <= k <= n <= 100000
- -1000000 <= each change <= 1000000