##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
5
1 0 0
1 0 1
2 11 10
5 10101 01100
5 00001 00110
The two strings are already equal, so no operation is needed.
Yes 0
No
Yes 2 1 2
Yes 3 5 2 4
Yes 2 5 2
Alice has two binary strings and of length . She has a special machine that, given an index where the current is , flips the entire prefix (changing to and to ). She can use this operation multiple times. Determine if she can transform into using at most operations, and if so, output any valid sequence of operations.
For each test case, output one of the following forms:
Here is the number of operations, , and for every . The operation indices must be valid in the given order. If there are multiple valid answers, you may output any of them.
It is impossible to perform any operation, because the only character of is . Therefore, cannot be changed into .
The output uses operations.
First, choose . The current value of is , so the operation is valid.
Then choose . The current value of is , so the operation is valid.
Now is equal to .
The output uses operations.
First, choose . The current value of is , so the operation is valid.
Then choose . The current value of is , so the operation is valid.
Then choose . The current value of is , so the operation is valid.
Now is equal to .
The output uses operations.
First, choose . The current value of is , so the operation is valid.
Then choose . The current value of is now , so the operation is valid.
Now is equal to .