Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

2990.   Simple Task
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 2143   Accepted Runs: 1427

WCM is a student of UESTC major in Math. He says he is the best Math student of UESTC. ZHC laughs hearing that, so he gives WCM a simple problem to solve. The problem is very simple. Given two sequences of integers (A1, A2,...,An) and (B1, B2, ..., Bm), you are to find how many pairs of integers (i, j) satisfying Ai + Bj = 0.

What an easy problem! But WCM works for three days and can't solve it. Now he returns to you for help. If you solve it, he will think you the best Math student of UESTC.


The first line of the input gives an integer t (t < 100), which is the number of test case.

For each test case, there are 4 lines. The first line gives the length of the first sequence n (0 < n ≤ 200), followed by a line containing n integers A1, A2,...,An separated by single space. The third and fourth lines describe the second sequence (B1, B2,... ,Bm) same as the first sequence above. (0 < m ≤ 200)

Every number in two sequences will be in the range of [-10000, 10000].


For each test case, output a line containing the answer.

Sample Input

1 2
-1 -2 -3
2 1

Sample Output


Source: The 4th UESTC Programming Contest
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz