You are a businessman who is fond of Vinia GPU. You buy Vinia GPUs from Byteland and sell them to Bitland. There are GPU shops in Byteland and GPU shops in Bitland. For some reason, the shop owners have put a restriction on you. From a shop in Byteland, you can buy at most GPU. Similarly, you can sell at most GPU to a shop in Bitland. The shop owners also decide the price of the GPU themselves.
You will be given the price of the Vinia GPU in the shops. You have to tell the maximum profit you can make. You can choose not to buy any GPU at all.
The input starts with an integer , the number of test cases.
In each test case, the first line contains two space-separated integers and , the number of shops in Byteland and Bitland respectively.
The next line contains space-separated integers. The integer represents the price of the Vinia GPU in the shop in Byteland.
The third line contains space-separated integers. The integer represents the price of the Vinia GPU in the shop in Bitland.
All the prices will be in range.
The sum of over all test cases and the sum of over all test cases will not exceed .
For each test case, print the maximum profit in a line.
Input | Output |
---|---|
2 3 4 10 70 20 50 60 1 5 3 1 10 70 20 50 | 80 40 |
In the first test case, you can buy two GPUs from shop and shop in Byteland and sell them to shop and shop in Bitland. |