给你一个有n个元素的数组a。a的每个元素不是0就是1。
让我们把a中连续元素的最长子段的长度表示为f(a),该子段只由数字1组成。你可以将不超过k个0改为1,以使f(a)最大化。
You are given an array a with n elements. Each element of a is either 0 or 1.
Let's denote the length of the longest subsegment of consecutive elements in a, consisting of only numbers one, as f(a). You can change no more than k zeroes to ones to maximize f(a).
Output
On the first line print a non-negative integer
z − the maximal value of
f(a) after no more than
k changes of zeroes to ones.
On the second line print
n integers
aj − the elements of the array
a after the changes.
If there are multiple answers, you can print any one of them.
Examples
Output
5
1 0 0 1 1 1 1 1 0 1
输入
10 3
0 0 1 0 0 1 0 0 1 1
输出
6
0 0 1 0 1 1 1 1 1 1