题目描述
A model show rates partakers according to their degree of fieriness. Two different model shows were organized, one for men and the other for women.
Now the repercussion of both model shows are out. The partakers of both the model shows have decided to date each other, but as usual they have difficuly in choosing their partners. The Dil Mil Gaye Serive (DMGS) comes to their rescue and matches them in such a way that that maximizes the fieriness bonds for all couples.
If a man has been rated at fieriness level x and a women at fieriness level y, the value of their fieriness bond is x*y.
Both model shows contain N partakers each. DMGS has done its job and your job is to find the sum of fieriness bonds for all the couples that DMGS has proposed.
Input
The first line of the input contains an integer t, the number of test cases. t (1 ≤ t ≤ 1500) test cases follow.
Each test case consists of 3 lines:
The first line contains a single integer N (1 ≤ N ≤ 1000).
The second line contains N integers separated by single spaces denoting the fieriness levels of the men.
The third line contains N integers separated by single spaces denoting the fieriness levels of the women.
note: All fieriness ratings are on a scale of 0 to 10.
Output
For each test case output a single line containing a single integer denoting the sum of the fieriness bonds for all pairs that DMGS has proposed.
SAMPLE INPUT
2
2
1 1
3 2
3
2 3 2
1 3 2
SAMPLE OUTPUT
5
15
输入格式
见题面
输出格式
见题面