#P1156C. Match Points
Match Points
Description
You are given a set of points , , ..., on the number line.
Two points and can be matched with each other if the following conditions hold:
- neither nor is matched with any other point;
- .
What is the maximum number of pairs of points you can match with each other?
The first line contains two integers and (, ) — the number of points and the constraint on the distance between matched points, respectively.
The second line contains integers , , ..., ().
Print one integer — the maximum number of pairs of points you can match with each other.
Input
The first line contains two integers and (, ) — the number of points and the constraint on the distance between matched points, respectively.
The second line contains integers , , ..., ().
Output
Print one integer — the maximum number of pairs of points you can match with each other.
Note
In the first example, you may match point with point (), and point with point ().
In the second example, you may match point with point ().