#d280. 锦标赛

锦标赛

Tournament

Problem Description

There are nn players in a competition, with ability values a1,a2,…,ana_1, a_2, \dots, a_n.

A total of n−1n - 1 rounds are held. In each round, among the players still remaining, any two players i,ji, j are chosen. If ∣ai−aj∣>K|a_i - a_j| > K, then the player with the higher ability value wins and the player with the lower ability value is eliminated. If ∣ai−aj∣≤K|a_i - a_j| \le K, then either of the two players may win and the other is eliminated.

After n−1n - 1 rounds, only one player remains. How many players could possibly be the final winner?

Input Format

The first line contains two integers n,Kn, K, the total number of players and the parameter of the winning condition.

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n, the ability values of the players.

Output Format

Output one integer: the number of players that could possibly win in the end.

Sample Input

5 3
1 5 9 6 3

Sample Output

5

Constraints

There are 1010 test cases in total.

Test point 11: n≤5n \leq 5.

Test point 22: n≤10n \leq 10.

Test points 3,4,53, 4, 5: n≤1000n \leq 1000.

For 100%100\% of the data: n≤105n \leq 10^5, 1≤ai,K≤1091 \leq a_i, K \leq 10^9.

Hint

See the accompanying problem materials.