#include using namespace std; #define ll long long #define db double #define X first #define Y second #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define rep0(i,a,b) for(int i=(a);i<(b);++i) #define per(i,a,b) for(int i=(a);i>=(b);--i) #define fore(i,a) for(int i=0;i>=1,a=1ll*a*a%P)if(b&1)r=1ll*r*a%P;return r; } int main() { int T=rd(); while(T--) { n=rd();k=rd(); rep(i,1,n)a[i]=rd(); sort(a+1,a+n+1); rep(i,1,n)l[i]=a[i]-k,r[i]=a[i]+k; int ans=1; rep(i,2,n) { if(l[i]<=l[i-1]) { l[i]=l[i-1]; if(l[i]