You are given a binary array of length and an array of length .
You may perform the following operation at most once.
Choose an index . If s_i=0, then the operation is allowed only if
If s_i=1, the operation is always allowed.
After choosing :
Set s_i=1.
Let be the largest index such that
If such an index exists, set s_l=1.
Let be the smallest index such that
If such an index exists, set s_r=1.
The indices and are determined using the array before the operation.
Find the maximum possible length of a contiguous segment consisting only of ones after performing the operation at most once.
The first line contains two integers and (1 \le n \le 2 \cdot 10^5, 0 \le k \le 10^{9}).
The second line contains integers s_1,s_2,\ldots,s_n (s_i \in \{0,1\}).
The third line contains integers c_1,c_2,\ldots,c_n (0 \le c_i \le 10^9).
Print one integer — the maximum possible length of a contiguous segment consisting only of ones after performing the operation at most once.
Example 1
In the example, choose i=5.
Since s_5=0 and c_5=3\le k, this operation is allowed.
The corresponding indices on the left and on the right are and , since
and
After the operation,
Thus, the answer is .
Subtask ( points): n \le 30.
Subtask ( points): n \le 5000.
Subtask ( points): No additional constraints.