#P17147. [ICPC 2017 Xi'an R] Lovers
[ICPC 2017 Xi'an R] Lovers
Problem Description
One day girls and boys come to Xi’an to look for a mate. Each girl has a value , each boy has a value . Girl and boy will fall in love only if .
Please help them make pairs as many as possible.
Input Format
Several test cases.
First line an integer (). Indicates the number of test cases.
Then test cases follow. Each test case begins with two integers , (). The next line has integers indicating to (). The next line has integers indicating to ().
Output Format
For each test case, print the answer in a single line.
1
3 4
1 2 3
1 2 3
3