#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-')
            w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
        s = s * 10 + ch - '0', ch = getchar(); // s=(s<<3)+(s<<1)+(ch^48);
    return s * w;
}
const int maxn = 1e5 + 9;
int a[maxn];
vector<int> vec;
int main() {
    int t;
    cin >> t;
    while (t--) {
        ll n, m;
        cin >> n >> m;
        for (int i = 1; i <= n; i++) {
            int x;
            cin >> x;
            vec.push_back(x);
        }
        sort(vec.begin(), vec.end());
        ll num = m;
        int tot = 0;
        while (vec.size()) {
            int pos = upper_bound(vec.begin(), vec.end(), num) - vec.begin();
            pos--;
            if (pos == -1) {
                num = m;
                tot++;
                continue;
            } else {
                num -= vec[pos];
                vec.erase(vec.begin() + pos);

                continue;
            }
        }
        cout << tot + 1 << endl;
    }
    return 0;
}
