| SVU-HIAST CPC 2025 |
|---|
| Закончено |
At Obada's party, Anas asked Abode to teach him some magic spells, so he taught him the well-known "A-to-B-Kedavra" spell, which is used to exchange elements between arrays. Because Anas is new to the magic world, he couldn't perfectly cast it. Anas has two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. He can use the spell as follows:
To test Anas's skills, Abode gave him a third array $$$c$$$ of length $$$n$$$ and asked him whether he could cast multiple (possibly zero) spells to make all three arrays equal ($$$a=b=c$$$). Can you help Anas??
The first line contains a single integer $$$tc :\ (1 \leq tc \leq 100)$$$ — the number of testcases.
The first line of each testcase contains a single integer $$$n \: (1 \leq n \leq 2 \cdot 10^5)$$$.
The second line of each testcase consists of $$$n$$$ integers $$$a_i \: (1 \leq a_i \leq 10^9)$$$.
The third line of each testcase consists of $$$n$$$ integers $$$b_i \: (1 \leq b_i \leq 10^9)$$$.
The fourth line of each testcase consists of $$$n$$$ integers $$$c_i \: (1 \leq c_i \leq 10^9)$$$.
It is guaranteed that the sum of $$$n$$$ over all testcases doesn't exceed $$$2 \cdot 10^5$$$.
For each testcase print "YES" if Anas could pass Abode's test, and "NO" otherwise.
332 6 42 3 42 4 432 5 42 3 42 4 432 6 42 4 32 4 4
YES NO YES
In the first test case, Anas could choose $$$i=2$$$, $$$X=2$$$, and $$$j=2$$$.
| Название |
|---|


