Problem Description
Given a sequence of N integers, find the number of pairs of integers of difference exactly K.
The integers will range from 0 to D inclusive.
Input
The first line of input will contain 2 single integers, N and K
The next line will contain N integers, which describe the sequence.
Output
Output a single integer, the number of pairs of integers where their difference is exactly K.
Subtasks
Subtask 1 (10 points): N, K, D ≤ 1000
Subtask 2 (10 points): N, K, D ≤ 10000
Subtask 3 (20 points): N ≤ 100000, K, D ≤ 1000000
Subtask 4 (20 points): N ≤ 500000, K, D ≤ 1000000
Subtask 5 (40 points): N ≤ 1000000, K, D will fit into a 32-bit signed integer
Subtask 6 (0 points): Sample Testcases
For subtask 1,2 and 3 there will be no repeated numbers.
For subtask 4 and 5 there will be repeated numbers.
Sample Input
10 5
1 2 3 4 5 6 7 8 9 10
Sample Output
5