Luffy wants to form a team for an upcoming raid. There are $$$n$$$ pirates available, and the fighting power of the $$$i$$$-th pirate is $$$a_i$$$.
Luffy must choose a nonempty team and select exactly one pirate from that team as its captain.
After excluding the captain, the fighting powers of the remaining team members must be close to each other. More precisely, if the remaining pirates have minimum fighting power $$$x$$$ and maximum fighting power $$$y$$$, then the following condition must hold: $$$y-x \le d.$$$
A team containing only one pirate is always valid, since that pirate can be chosen as the captain.
Find the maximum possible number of pirates in a valid team.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^{4}$$$) — the number of test cases.
The first line of each test case contains two integers $$$n$$$ and $$$d$$$ ($$$1 \le n \le 2 \times 10^{5}$$$, $$$0 \le d \le 10^{9}$$$) — the number of pirates and the maximum difference.
The second line contains $$$n$$$ integers $$$a_{1}, a_{2}, \dots, a_{n}$$$ ($$$0 \le a_{i} \le 10^{9}$$$) — the power of the pirates.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \times 10^{5}$$$.
For each test case, output one integer — the biggest team size.
23 11 10 111 07
31
In the first test case, choose all three pirates. Make the pirate with strength 1 the captain, so only strengths 10 and 11 are checked.
In the second test case, the one-person team is valid.