| 2026年“登峰杯”大学生程序设计联赛 |
|---|
| Finished |
You are given two integer arrays $$$a$$$ and $$$b$$$, each of length $$$n$$$. You may perform the following operation:
You may perform any finite number of operations on either array, including zero operations. Determine whether you can make the arrays equal: $$$a_i=b_i$$$ for every $$$1\le i\le n$$$.
The first line contains an integer $$$t$$$ ($$$1\le t\le10^4$$$) — the number of test cases.
The first line of each test case contains an integer $$$n$$$ ($$$3\le n\le5\cdot10^5$$$) — the length of each array.
The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$-10^9\le a_i\le10^9$$$).
The third line contains $$$n$$$ integers $$$b_1,b_2,\ldots,b_n$$$ ($$$-10^9\le b_i\le10^9$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$5\cdot10^5$$$.
For each test case, print YES if you can make the two arrays equal, and NO otherwise.
431 2 33 -2 530 0 00 0 140 0 1 -10 1 -1 041 2 3 41 3 2 4
YES NO YES NO
| Name |
|---|


