| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 38 | 30 | 25 | 83.333% |
A wrestling competition will be held tomorrow. A total of $n$ players will take part in it. The $i$-th player's strength is $a_i$.
If there is a match between the $i$-th player and the $j$-th player, the result will depend solely on $|a_i - a_j|$. If $|a_i - a_j| > K,ドル the player with the higher strength will win. Otherwise, each player will have a chance to win.
The competition rules are a little strange. For each fight, the referee will choose two players from all remaining players uniformly at random and hold a match between them. The loser will be eliminated. After $n - 1$ matches, the last remaining player will be the winner.
Given the numbers $n$ and $K$ and the array $a,ドル find how many players have a chance to win the competition.
The first line of the input contains two integers $n$ and $K$ (1ドル \leq n \leq 10^5,ドル 0ドル \leq K < 10^9$).
The second line contains $n$ integers $a_i$ (1ドル \leq a_i \leq 10^9$).
Print a single line with a single integer: the number of players which have a chance to win the competition.
5 3 1 5 9 6 3
5
5 2 1 5 9 6 3
1