#include <iostream>
#include<vector>
#include <string>
#include <sstream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
typedef unsigned long long int ull;
using namespace std;
ull ni();
int compare (const void * a, const void * b)
{
return ( *(ull*)b - *(ull*)a );
}
ull ni()
{
int c = getchar();
while (c != '-' && (c < '0' || c > '9')) c = getchar();
int sg = 0;
if (c == '-') {
sg = 1;
c = getchar();
}
ull ret = 0LL;
while (c >= '0' && c <= '9') {
ret = ret * 10 + c - '0';
c = getchar();
}
return sg ? -ret : ret;
}
int main()
{
int t,n,coun=0,k;
ull p[10],m,sum=0;
cin>>t;
if(t>7777)
t=7777;
while(t--)
{ sum=0;
coun=0;
n=ni();
if(n>7)
n=7;
else if(n<1)
n=1;
m=ni();
for(int i=0;i<n;i++)
{
p[i]=ni();
}
sort(p,p+n);
for(k=n-1;k>=0;k--)
{
sum=sum+p[k];coun++;
if(sum>=m)
{
break;
}
}
if(m>sum)
{
coun=-1;
}
cout<<coun;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTx2ZWN0b3I+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPGNzdGRpbz4KI2luY2x1ZGU8Y3N0ZGxpYj4KdHlwZWRlZiB1bnNpZ25lZCBsb25nIGxvbmcgaW50IHVsbDsKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnVsbCBuaSgpOwppbnQgY29tcGFyZSAoY29uc3Qgdm9pZCAqIGEsIGNvbnN0IHZvaWQgKiBiKQp7CiAgcmV0dXJuICggKih1bGwqKWIgLSAqKHVsbCopYSApOwp9CgoKdWxsIG5pKCkKewppbnQgYyA9IGdldGNoYXIoKTsKd2hpbGUgKGMgIT0gJy0nICYmIChjIDwgJzAnIHx8IGMgPiAnOScpKSBjID0gZ2V0Y2hhcigpOwppbnQgc2cgPSAwOwppZiAoYyA9PSAnLScpIHsKc2cgPSAxOwpjID0gZ2V0Y2hhcigpOwp9CnVsbCByZXQgPSAwTEw7CndoaWxlIChjID49ICcwJyAmJiBjIDw9ICc5JykgewpyZXQgPSByZXQgKiAxMCArIGMgLSAnMCc7CmMgPSBnZXRjaGFyKCk7Cn0KcmV0dXJuIHNnID8gLXJldCA6IHJldDsKfQppbnQgbWFpbigpCnsKCiAgICBpbnQgdCxuLGNvdW49MCxrOwogdWxsIHBbMTBdLG0sc3VtPTA7CiAgIGNpbj4+dDsKICAgaWYodD43Nzc3KQogICAgdD03Nzc3OwogICAgd2hpbGUodC0tKQogICAgeyAgIHN1bT0wOwogICAgICAgIGNvdW49MDsKICAgICAgICBuPW5pKCk7CiAgICAgICAgaWYobj43KQogICAgICAgICAgICBuPTc7CiAgICAgICAgZWxzZSBpZihuPDEpCiAgICAgICAgICAgIG49MTsKICAgICAgICBtPW5pKCk7CgoKICAgICAgICBmb3IoaW50IGk9MDtpPG47aSsrKQogICAgICAgIHsKICAgICAgICAgIHBbaV09bmkoKTsKICAgICAgICB9CiAgICAgICAgc29ydChwLHArbik7CiAgICAgICAgZm9yKGs9bi0xO2s+PTA7ay0tKQogICAgICAgIHsKICAgICAgICAgICAgc3VtPXN1bStwW2tdO2NvdW4rKzsKICAgICAgICAgICAgaWYoc3VtPj1tKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYobT5zdW0pCiAgICAgICAgewogICAgICAgICAgICBjb3VuPS0xOwogICAgICAgIH0KICAgICAgICBjb3V0PDxjb3VuOwogICAgfQoKfQ==