Sarla inherited the foundry at the forest village of Briarthorn along with its curious bookkeeping system for ribbons. Time to make sense of it. Task: A binary array may flip at most k zeros to ones. Print the longest run of ones achievable. Input format: First line: n and k. Second line: n values 0/1. Output format: Print the maximum run length. Constraints: 1 <= n <= 4000; 0 <= k <= n; a[i] in {0,1}.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 4000; 0 <= k <= n; a[i] in {0,1}.
