Problem: You are given two arrays and , both of length .
Your task is to count the number of pairs of integers such that and .
Input Format: Each test contains multiple test cases. The first line of input contains a single integer () — the number of test cases. The description of test cases follows.
The first line of each test case contains a single integer () — the length of the arrays.
The second line of each test case contains integers () — the elements of array .
The third line of each test case contains integers () — the elements of array .
It is guaranteed that the sum of across all test cases does not exceed .
Output Format: For each test case, output the number of good pairs.
Note: In the first sample, there are good pairs:
- ,
- .
In the second sample, there are good pairs:
- ,
- ,
- ,
- ,
- ,
- ,
- .