#P8279. 「MCOI-08」Fill In REMATCH
「MCOI-08」Fill In REMATCH
Description
Dream has an integer array of length (). For , it holds that .
He computed the prefix XOR array and the suffix XOR array .
Now Tommy has replaced a total of elements in and with . Given the current arrays and , restore any possible array .
It is guaranteed that a valid solution exists.
Input Format
This problem contains multiple test cases. The first line contains a positive integer , the number of test cases. Then follow test cases. For each test case:
The first line contains a positive integer ().
The next line contains integers .
The next line contains integers .
Output Format
For each test case:
Output non-negative integers that satisfy the above conditions.
1
4
-1 34 367 -1
3178 -1 -1 3333
3 33 333 3333
Hint
For of the testdata, , , and a valid solution is guaranteed to exist.
- Subtask 1 (10 pts): , .
- Subtask 2 (10 pts): .
- Subtask 3 (20 pts): .
- Subtask 4 (60 pts): No special constraints.
Translated by ChatGPT 5
京公网安备 11011102002149号