#UnknownID10. JIXMPII5JUhOXI0#?@'
JIXMPII5JUhOXI0#?@'
Statement
Given an array of integers, an array of integers, and an even number .
Your task is to determine whether it is possible to choose exactly elements from both arrays in such a way that among the chosen elements, every integer from to is included.
For example:
- If , , , then it is possible to choose elements with values from array and elements with values from array . In this case, all numbers from to will be included among the chosen elements.
- If , , , then it is not possible to choose elements in the required way.
Note that you are not required to find a way to choose the elements — your program should only check whether it is possible to choose the elements in the required way.
Format
Input
The first line of the input contains a single integer ( ) — the number of test cases. The descriptions of the test cases follow.
The first line of each test case contains three integers , , and ( , , is even) — the length of array , the length of array , and the number of elements to be chosen, respectively.
The second line of each test case contains integers ( ) — the elements of array .
The third line of each test case contains integers ( ) — the elements of array .
It is guaranteed that the sum of values and over all test cases in a test does not exceed .
Output
Output lines, each of which is the answer to the corresponding test case. As the answer, output "YES" if it is possible to choose numbers from each array in such a way that among the chosen elements, every integer from to is included. Otherwise, output "NO".
Sample
6
6 5 6
2 3 8 5 6 5
1 3 4 10 5
6 5 6
2 3 4 5 6 5
1 3 8 10 3
3 3 4
1 3 5
2 4 6
2 5 4
1 4
7 3 4 4 2
1 4 2
2
6 4 4 2
1 5 2
3
2 2 1 4 3
YES
NO
YES
YES
NO
NO
相关
在下列比赛中: