In a futuristic digital city, there is a long street made up of KaTeX can only parse string typed expression glowing panels placed in a row.
Each panel can be in one of two states:
-
KaTeX can only parse string typed expression — the panel is bright and active
-
KaTeX can only parse string typed expression — the panel is dark and inactive
A technician is assigned the task of inspecting this street. The technician wants to walk along the street on a continuous stretch of bright panels only, without stepping on any dark ones.
Fortunately, the technician has a limited power source that allows them to flip at most KaTeX can only parse string typed expression dark panels into bright panels.
The task is to determine the maximum possible length of a continuous segment of bright panels the technician can obtain after using this power at most KaTeX can only parse string typed expression times.
The second line contains KaTeX can only parse string typed expression integers, representing the state of each panel
KaTeX can only parse string typed expression — where each value is either KaTeX can only parse string typed expression or KaTeX can only parse string typed expression.
10 2
1 0 1 1 0 0 1 1 1 0
Output
7
Explanation
The technician examines the street and decides to use their power on two dark panels located in the middle of the street.
Once these panels are flipped to bright, the street becomes easier to traverse.
As a result, the technician can now walk across a continuous stretch of KaTeX can only parse string typed expression bright panels without interruption — the longest possible path under the given constraints.