| Kotlin Heroes: Episode 14 |
|---|
| Finished |
The median of the sequence $$$[s_1, s_2, \dots, s_k]$$$ is defined as the element that appears at position $$$\lfloor \frac{k+1}{2} \rfloor$$$ when the sequence is sorted in non-decreasing order. For example, the median of the sequence $$$[4, 5, 6, 1, 2, 2]$$$ is $$$2$$$; the median of the sequence $$$[3, 6, 3, 4, 5]$$$ is $$$4$$$.
You are given two arrays $$$[a_1, a_2, \dots, a_n]$$$ and $$$[b_1, b_2, \dots, b_m]$$$, sorted in non-decreasing order. Both arrays have odd lengths.
In one operation, you can do the following:
Your task is to determine whether it is possible to make the arrays equal.
The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
Each test case consists of three lines:
Additional constraints on the input:
For each test case, output YES if it is possible to make the arrays equal, or NO if it is not possible.
35 31 2 3 4 51 3 73 511 17 1919 20 26 29 371 7111 2 7 9 11 15 17
YESNOYES
In the first example, the arrays can be made equal by applying the following sequence of operations:
| Name |
|---|


