Count the number of distinct value pairs (a, b) with a <= b and b - a == k such that both a and b occur in the array. Pairs are counted by their values, not by index, so each distinct pair is counted once.
Note k may be 0, in which case a pair is a value that occurs at least twice.
Input format
Line 1: two integers n and k.
Line 2: n space-separated integers (present whenever n >= 1).
Output format
One line: the number of distinct qualifying value pairs.
Constraints
- 1 <= n <= 100000
- 0 <= k <= 1000000000
- -1000000000 <= each value <= 1000000000