#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int T;
cin >> T;
int n, a, b[25], i, cnt;
while(T--) {
int Min = 50;
bool tag = false;
cin >>n >> a;
for(int i = 0; i < n; ++i)
cin >> b[i];
sort(b, b+n);
for(i = n-1; i >= 0; --i) {
if(a >= b[i])
break;
}
if(i == 0) {
if(a % b[0] == 0)
cout << 1 << endl;
else
cout << -1 << endl;
} else {
for(int j = 1; j < (1 << (i+1)); ++j) {
int tmp = a;
cnt = 0;
for(int k = i; k >= 0 ; --k) {
if((1 << k) & j) {
tmp %= b[k];
cnt++;
//cout << j << " " <<tmp << " " << b[k] << " "<<cnt << endl;;
}
}
if(tmp == 0) {
Min = min(Min, cnt);
tag = true;
}
}
if(tag)
cout << Min << endl;
else
cout << -1 << endl;
}
}
return 0;
}