#include <bits/stdc++.h>
using namespace std;
using ll = long long;


int main() {
	ios_base::sync_with_stdio(false); cin.tie(nullptr); 
	#ifndef ONLINE_JUDGE 
		freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); 
	#endif 	

	int _; cin >> _;
	while(_--) {
		int n, w; cin >> n >> w;
		multiset<int,greater<int>> s;
		for(int i = 0; i < n; i++) {
			int x; cin >> x;
			s.insert(x);
		}
		int p = 0, c = 1;
		while(s.size()) {
			if(s.lower_bound(w-p) == s.end()) {
				c++;
				p = 0;
			}
			else {
				int x = *s.lower_bound(w-p);
				p += x;
				s.erase(s.lower_bound(x));
			}
		}
		cout << c << '\n';
	} 
}