#include using namespace std; int n,a[100005],cnt,B,k; int T; int read(){ int x=0;char ch=getchar(); while(!isdigit(ch)) ch=getchar(); while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar(); return x; } void print(int x){ if(x>=10) print(x/10); putchar(x%10+'0'); } int main(){ T=read(); while(T--){ n=read(),k=read(); for(int i=1;i<=n;i++) a[i]=read(); sort(a+1,a+n+1); cnt=1,B=a[1]-k; for(int i=2;i<=n;i++){ if(a[i]==a[i-1]){ if(B+1<=a[i]+k) B++,cnt++; } else{ if(B+1