Taekwondo is a traditional Korean martial art that has grown into a modern international sport, adopted by the IOC (International Olympic Committee) as an official event of the 2000 Sydney Olympic Games. Taekwondo has both individual matches and team matches. An individual match is contested by two players, and a team match is a collection of individual matches.
You are given two groups of players and want to organize a team match. For each individual match you pick one player from the first group and one player from the second group. Every player may take part in at most one individual match, so if the two groups have sizes n1 and n2, you form exactly min{n1,n2} individual matches.
For a fair contest, the two players in each individual match should have weights that are as close as possible. Given the weights of the players in both groups, find a pairing that minimizes the sum, over all individual matches, of the absolute difference between the two paired players' weights.
The first line contains an integer T, the number of test cases.
Each test case begins with a line containing two integers n1 and n2 (1≤n1,n2≤500), the number of players in the first and second groups. The next n1 lines each contain the weight of one player in the first group, and the following n2 lines each contain the weight of one player in the second group. Every weight is between 40.0 and 130.0 and is given to one decimal place (a multiple of 0.1). You must form min{n1,n2} pairs.
For each test case, print on its own line the minimum possible sum of the absolute weight differences over the min{n1,n2} individual matches. Print the value with exactly one digit after the decimal point.