#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int t=0;
cin>>t;
while(t--)
{
ll n=0; ll vac=0;
cin>>n>>vac;
ll a[n]={0};
for(ll i=0;i<n;i++)
{
cin>>a[i];
}
//sorting array
sort(a,a+n);
//case: when vaccine is greater than country having highest no. of infected population
if(vac>=a[n-1])
{
cout<<n<<endl;
continue;
}
// all the other cases
else
{
ll pos=0; // for finding the correct position from where we have to count no. of days
ll days=0;
for(ll i=0;i<n;i++)
{
if(a[i]>=vac)
{
pos=i;// for eg. lets i=4, when the condition is satisified
break;// that means country at a[0],a[1],a[2],a[3] can be
//cured in 4 days after rest of the countries are cured.
}
}
days=pos; //so we assign same to the days from above loop result.
while(pos<n)
{
days++;// since days=0, so day 1,2,3,.....
if(a[pos]<=vac)
{
vac=a[pos];
pos++;
}
vac=vac*2;
}
cout<<days<<endl;
}
}
return 0;
}