#include <bits/stdc++.h>

using namespace std;

#define ll long long

int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
    	ll n,w;
    	cin>>n>>w;
    	ll a[n];
    	multiset<ll> ms;
    	for(int i = 0;i<n;i++)
    	{
    		cin>>a[i];
    		ms.insert(a[i]);
    	}
    	ll ans = 1;
    	ll temp = w;
    	while(!ms.empty())
    	{
    		auto it = ms.upper_bound(temp);
    		if(*it > temp && it == ms.begin())
    		{
    			temp = w;
    			ans++;
    			continue;
    		}
    		it--;
    		temp -= (*it);
    		ms.erase(it);
    	}
    	cout<<ans<<"\n";
    }
}