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 K. Count index pairs (i, j) with i < j and |A[i] - A[j]| = K.

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
1

5 2
1 5 3 4 2
Output
3


Example 2:
Input
1

4 0
7 7 7 7
Output
6

Online