// Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
typedef long long int  ll;
typedef pair<int, int>PI;
typedef pair<ll, ll > PL;
typedef vector<int>VI;
typedef vector<ll>VL;
#define FF first
#define SS second
#define FOR(i,n) for(int i=0;i<n; i++)
#define F0R(i,a, b) for(int i=a;i<b; i++)
#define FORd(i,n) for(int i=  n-1; i>=0;i--)
#define F0Rd(i, a, b) for(int i= b-1; i>=a; i--)
const int mod = 1e9 + 7;
const int INF = 1e9;
const int N = 1e5 + 5;
ll pro[18];
int find_log(int n)
{
	int i;
	for (i = 31; i >= 0; i--)
	{
		if ((1 << i)&n)
		{
			break;
		}
	}
	return i;
}
int main()
{
	ios::sync_with_stdio(false);   cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t;
	cin >> t;
	while (t--)
	{
		int n , W, x;
		cin >> n >> W;
		multiset<int>ms;
		for (int i = 0; i < n; i++)
		{
			cin >> x;
			ms.insert(x);
		}
		ll ans  = 1, space_left = W;
		while (!ms.empty())
		{
			auto it  = ms.upper_bound(space_left);
			if (it != ms.begin())
			{
				it--;
				space_left = space_left - *it;
				ms.erase(it);
			}
			else
			{
				space_left = W;
				ans++;
			}
		}
		cout << ans << endl;
	}

	return 0;
}
