#include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define saleh \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
#define ll long long
int main()
{
saleh;
int t;
cin >> t;
while (t--)
{
int n, sum;
cin >> n >> sum;
int ans = 0;
vector<int> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
for (int mask = 0; mask < (1 << n); mask++)
{
int s = 0;
for (int i = 0; i < n; i++)
{
if (mask & (1 << i))
{
s += v[i];
}
}
int bits = __builtin_popcount(mask);
if (s < sum)
continue;
bool flag = 0;
for (int i = 0; i < n; i++)
{
if (mask & (1 << i))
{
if (s - v[i] >= sum)
flag = 1;
}
}
if (!flag)
ans = max(ans, bits);
}
cout << ans << endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIHNhbGVoICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBcCiAgICBjaW4udGllKG51bGxwdHIpOwojZGVmaW5lIGxsIGxvbmcgbG9uZwoKaW50IG1haW4oKQp7CgogICAgc2FsZWg7CgogICAgaW50IHQ7CiAgICBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pCiAgICB7CiAgICAgICAgaW50IG4sIHN1bTsKICAgICAgICBjaW4gPj4gbiA+PiBzdW07CiAgICAgICAgaW50IGFucyA9IDA7CiAgICAgICAgdmVjdG9yPGludD4gdihuKTsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgICAgICAgICAgY2luID4+IHZbaV07CgogICAgICAgIGZvciAoaW50IG1hc2sgPSAwOyBtYXNrIDwgKDEgPDwgbik7IG1hc2srKykKICAgICAgICB7CiAgICAgICAgICAgIGludCBzID0gMDsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmIChtYXNrICYgKDEgPDwgaSkpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgcyArPSB2W2ldOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGludCBiaXRzID0gX19idWlsdGluX3BvcGNvdW50KG1hc2spOwogICAgICAgICAgICBpZiAocyA8IHN1bSkKICAgICAgICAgICAgICAgIGNvbnRpbnVlOwoKICAgICAgICAgICAgYm9vbCBmbGFnID0gMDsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmIChtYXNrICYgKDEgPDwgaSkpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgaWYgKHMgLSB2W2ldID49IHN1bSkKICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IDE7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKCFmbGFnKQogICAgICAgICAgICAgICAgYW5zID0gbWF4KGFucywgYml0cyk7CiAgICAgICAgfQoKICAgICAgICBjb3V0IDw8IGFucyA8PCBlbmRsOwogICAgfQp9