| Codeforces Round 1114 (Div. 3) |
|---|
| Finished |
Yousef has given you an even integer $$$n$$$ and two arrays, $$$a$$$ and $$$b$$$, both consisting of $$$n$$$ non-negative integers.
You can perform the following operation on array $$$a$$$ any number of times (possibly zero):
Determine whether it is possible to transform array $$$a$$$ into array $$$b$$$ using a finite number of operations.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains an even integer $$$n$$$ ($$$2 \le n \le 2 \cdot 10^5$$$) — the length of the array.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 \le a_i \lt 2^{30}$$$) — the elements of the array $$$a$$$.
The third line of each test case contains $$$n$$$ integers $$$b_1, b_2, \dots, b_n$$$ ($$$0 \le b_i \lt 2^{30}$$$) — the elements of the array $$$b$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output "YES" if the array $$$a$$$ can be transformed into array $$$b$$$ using a finite number of operations, and "NO" otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
621 21 041 2 4 76 7 5 341 2 4 88 4 2 141 2 3 41 2 4 541 2 0 33 3 0 363 5 6 9 10 126 5 3 12 15 9
NOYESYESNONOYES
In the first test case, starting from $$$[1, 2]$$$, there is no sequence of operations that ends at $$$[1, 0]$$$, so the answer is "NO".
In the second test case, one valid sequence is:
In the third test case, one valid sequence is:
| Name |
|---|


