#P1572B. Xor of 3
Xor of 3
Description
You are given a sequence of length consisting of s and s.
You can perform the following operation on this sequence:
- Pick an index from to (inclusive).
- Change all of , , to simultaneously, where denotes the bitwise XOR operation
We can prove that if there exists a sequence of operations of any length that changes all elements of to s, then there is also such a sequence of length not greater than .
Each test contains multiple test cases. The first line contains the number of test cases ().
The first line of each test case contains a single integer () — the length of .
The second line of each test case contains integers ( or ) — elements of .
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, do the following:
- if there is no way of making all the elements of equal to after performing the above operation some number of times, print "NO".
- otherwise, in the first line print "YES", in the second line print () — the number of operations that you want to perform on , and in the third line print a sequence () — the indices on which the operation should be applied.
If there are multiple solutions, you may print any.
Input
Each test contains multiple test cases. The first line contains the number of test cases ().
The first line of each test case contains a single integer () — the length of .
The second line of each test case contains integers ( or ) — elements of .
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, do the following:
- if there is no way of making all the elements of equal to after performing the above operation some number of times, print "NO".
- otherwise, in the first line print "YES", in the second line print () — the number of operations that you want to perform on , and in the third line print a sequence () — the indices on which the operation should be applied.
If there are multiple solutions, you may print any.
Note
In the first example, the sequence contains only s so we don't need to change anything.
In the second example, we can transform to and then to by performing the operation on the third element of and then on the first element of .
In the third example, no matter whether we first perform the operation on the first or on the second element of we will get , which cannot be transformed to .