##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given two binary strings and , both of length .
In one operation, you choose two indices and such that , and the substring is a palindrome. Then you invert every bit in this substring. In other words, every becomes , and every becomes .
You have to determine whether it is possible to transform into .
If it is possible, output any sequence of at most operations that transforms into .
The first line contains an integer , the number of test cases.
Then the test cases are given in the following format:
For each test case, if it is impossible to transform into , output:
Otherwise, output:
Here is the number of operations, and it must satisfy . For every , the segment must be valid at the moment when the -th operation is applied.
The words Yes and No must be printed exactly in this form.
If there are several valid answers, output any of them.
The chosen substring from positions 1 to 5 is 01010, which is a palindrome. After inverting it, the string becomes 10101, so it is equal to the target string.
It is impossible.
0101 becomes 1011, then 1000, then 1111, and finally 0000.
11100 becomes 00000, then 00111.