Since the author of this problem is too lazy to write a problem statement, he will provide you with the problem sketch only.
You're given an array $$$a$$$ of length $$$n$$$ consisting of zeros and ones, and an integer $$$k$$$.
You can perform no more than $$$n$$$ operations. In one operation, you take a range of length exactly $$$k$$$ and flip its values, making every $$$0$$$ a $$$1$$$ and every $$$1$$$ a $$$0$$$.
More formally, in each operation you can choose a value $$$l$$$ ($$$1 \le l \le n-k+1$$$) then do the assignment $$$a_i := 1-a_i$$$ for every $$$i$$$ such that $$$l \le i \le l+k-1$$$
Your task is to modify the array so that it contains no more than $$$\lfloor\frac{k}{2}\rfloor$$$ zeros.
Print the sequence of operations. If there are multiple answers, print any.
The first line contains two integers, $$$n$$$ and $$$k$$$, where $$$(1 \leq k \leq n \leq 10^6)$$$.
The second line contains $$$n$$$ integers, $$$a_i$$$, where $$$(0 \leq a_i \leq 1)$$$.
The first line contains a number, $$$m$$$, which represents the number of operations.
The second line contains $$$m$$$ integers, which represent the left side of each range.
If there are multiple answers, you can print any.
3 2 1 0 1
0
4 2 0 0 0 0
2 1 3
in the first test you don't need to do any operations.
in the second test you can just do operations in [1,2] and [3,4].
| Название |
|---|


