Question
Badge Pairs with Secret Gap
At an event, every participant receives a badge number. The organizer wants to count pairs of participants whose badge numbers differ by exactly
The twist: duplicates matter because participants are different even if badge numbers match.
Input
The first line contains KaTeX can only parse string typed expression. For each test case, the first line contains KaTeX can only parse string typed expression and KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression integers.
Output
For each test case, print the number of valid pairs in different lines.
Example
Example 1:
Input
Example 2:
Input
Input
1
5 2
1 5 3 4 2Output3Example 2:
Input
1
4 0
7 7 7 7Output6