|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|3 초||256 MB||5||5||5||100.000%|
Ezra Cornell and A. D. White learned their lesson from their last party, so this time they decided to use names instead of identifiers. They also realized that they shouldn’t trust their memories so much, so they’ve decided to write down the guest names as they arrive. After a few hours they got tired of staying at the door and decided to mingle. They did, however, continued to take note of every single person they encountered. Since they were separated, they could have encountered a completely different set of people.
At the end of their party they decided to figure out how many people were there. They both put their list on the table, and soon realized that they can only determine the minimum number of people that went. Basically, if a name is in either list, this person went to the party. Fortunately, no two people with the same name attended the party. Can you help Cornell and White again?
The input consists of several test cases. The input starts with the number of test cases. Each test case starts with two numbers N and M in a line, the size of Cornell’s list and White’s list respectively. The following line will contain the N names in Cornell’s list, and the next line will contain the M names in White’s list. 1 ≤ N ≤ 100,000, 1 ≤ M ≤ 100,000. The names will consist only of lower case letters and will consist of at most 10 characters.
For each test case you should output the minimum number of people who attended the party.
3 3 3 agnes clelia agnes cynara cynara elvira 3 4 zilla zilla zilla zilla mason primrose mason 4 5 ramona ludmilla ramona anthea ludmilla anthea briette anthea ramona
4 3 4