#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
long long int t,m,p[7],sum;
int i,count,n;
cin>>t;
while(t--)
{
count=0;
sum=0;
cin>>n;
cin>>m;
for(i=0;i<n;i++)
cin>>p[i];
vector<long long int> myvector(p,p+n);
sort(myvector.begin(),myvector.end(),greater<int>());
for(vector<long long int>::iterator it=myvector.begin();it!=myvector.end();++it)
{
sum=sum+*it;
count++;
if(sum>=m)
{
break;
}
}
if(sum>=m)
cout<<count<<"\n";
else
cout<<-1<<"\n";
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGFsZ29yaXRobT4KI2luY2x1ZGU8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKICAgIGxvbmcgbG9uZyBpbnQgdCxtLHBbN10sc3VtOwoJaW50IGksY291bnQsbjsJCgljaW4+PnQ7Cgl3aGlsZSh0LS0pCgl7CQoJCgkJY291bnQ9MDsKCQlzdW09MDsKCQljaW4+Pm47CgkJY2luPj5tOwoJCWZvcihpPTA7aTxuO2krKykKCQkJY2luPj5wW2ldOwoJCXZlY3Rvcjxsb25nIGxvbmcgaW50PiBteXZlY3RvcihwLHArbik7CgkJc29ydChteXZlY3Rvci5iZWdpbigpLG15dmVjdG9yLmVuZCgpLGdyZWF0ZXI8aW50PigpKTsKCQlmb3IodmVjdG9yPGxvbmcgbG9uZyBpbnQ+OjppdGVyYXRvciBpdD1teXZlY3Rvci5iZWdpbigpO2l0IT1teXZlY3Rvci5lbmQoKTsrK2l0KQoJCXsKCQkJc3VtPXN1bSsqaXQ7CgkJCWNvdW50Kys7CgkJCWlmKHN1bT49bSkKCQkJewoJCQkJYnJlYWs7CgkJCX0JCgkJCQoJCX0KCQlpZihzdW0+PW0pCgkJY291dDw8Y291bnQ8PCJcbiI7CgkJZWxzZQoJCWNvdXQ8PC0xPDwiXG4iOwoJfQoJcmV0dXJuIDA7Cn0K