logo AlgoBeat OnlineJudge
登录 注册

#217098. [ICPC 2017 Xi'an R] Lovers

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

输入格式

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 ().

输出格式

For each test case, print the answer in a single line.

样例

样例输入 1

1
3 4
1 2 3
1 2 3

样例输出 1

3