#pragma GCC optimize("Ofast") #include #define int long long using namespace std; void fileio(const string &s) { freopen((s+".in").c_str(),"r",stdin); freopen((s+".out").c_str(),"w",stdout); } const int INF=4e18; inline int read() { int x=0; bool flag=1; char c=getchar(); while(c<'0'||c>'9') { if(c=='-') flag=0; c=getchar(); } while(c>='0'&&c<='9') { x=(x<<1)+(x<<3)+c-'0'; c=getchar(); } return (flag?x:~(x-1)); } int t,n,k,ans,lst,a[100001]; void solve() { n=read(); k=read(); for(int i=1;i<=n;i++) a[i]=read(); sort(a+1,a+1+n); lst=a[1]-k+1; ans=0; for(int i=2;i<=n;i++) { if(a[i]+k