#include using namespace std; #define LL long long #define LD long double const LL INF=1e18; const LD eps=1e-18; const int N=2e5+10; const LL P=998244353; const LD PI=acos(-1.0); LL qpow(LL x,LL y){ LL re=1; while(y){ if(y&1) re=re*x%P; x=x*x%P;y>>=1; } return re; } int n,K; int b[N]; void MAIN(){ scanf("%d%d",&n,&K); for(int i=1;i<=n;++i){ scanf("%d",&b[i]); b[i]-=K; } sort(b+1,b+1+n); int r=b[1],ans=1; for(int i=2;i<=n;++i){ if(rr){ ++r; ++ans; } } printf("%d\n",ans); return; } int main(){ //init(); int ttt=1;scanf("%d",&ttt); while(ttt--) MAIN(); return 0; }