#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define pc putchar_unlocked
#define gc getchar_unlocked
#define ll long long unsigned int
ll m() {
ll tmp;
scanf("%lld", &tmp);
return tmp;
/* ll x=0;
char c=gc();
while(c<48||c>57)
c=gc();
while(c>=48&&c<=57) {
x=x*10+c-48; c=gc(); }
return x;*/
}
int compare(const void *a,const void *b)
{
return( *(ll*)a - *(ll*)b );
}
ll a[8];
int main() {
int n,f,i,c;
ll t,M,p;
t=m();
while(t--) {
f=0;
c=0;
p=0;
memset(a,0,sizeof(a));
n=m();
M=m();
for(i=0;i<=n-1;i++)
a[i]=m();
qsort(a,n,sizeof(ll),compare);
for(i=n-1;i>=0;i--)
{
p+=a[i];
c++;
if(p>=M) {
f=1;
break;
}
}
if(f==1)
printf("%d\n",c);
else
printf("-1\n");
}
return 0;
}
I2luY2x1ZGU8c3RyaW5nLmg+CiNpbmNsdWRlPHN0ZGxpYi5oPgojaW5jbHVkZTxzdGRpby5oPgojZGVmaW5lIHBjIHB1dGNoYXJfdW5sb2NrZWQgCiNkZWZpbmUgZ2MgZ2V0Y2hhcl91bmxvY2tlZCAKI2RlZmluZSBsbCBsb25nIGxvbmcgdW5zaWduZWQgaW50CmxsIG0oKSB7CglsbCB0bXA7CglzY2FuZigiJWxsZCIsICZ0bXApOwoJcmV0dXJuIHRtcDsKLyogbGwgeD0wOwogY2hhciBjPWdjKCk7CiB3aGlsZShjPDQ4fHxjPjU3KSAKYz1nYygpOwogd2hpbGUoYz49NDgmJmM8PTU3KSB7IAp4PXgqMTArYy00ODsgYz1nYygpOyB9IApyZXR1cm4geDsqLwp9CgkJCQkJCQppbnQgY29tcGFyZShjb25zdCB2b2lkICphLGNvbnN0IHZvaWQgKmIpCnsKcmV0dXJuKCAqKGxsKilhIC0gKihsbCopYiApOwp9CmxsIGFbOF07CmludCBtYWluKCkgewoJaW50IG4sZixpLGM7CglsbCB0LE0scDsJCgl0PW0oKTsKCXdoaWxlKHQtLSkgewoJCWY9MDsKC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