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

void box()
{
   int n,i,count,max=0;
   long long int width,w;
   cin>>n>>width;
   int h[100001];
    map<int ,int,greater<int>>m;
    for(i=0;i<n;i++)
    {
        cin>>w;
        m[w]++;
    }
    for(i=1;i<=100000;i++)
      h[i]=width;
    auto j=m.begin();
    while(j!=m.end())
    {
        for(i=1;i<=100000;i++)
        {
            if(max<i)
            max=i;
            if(j->first<=h[i])
            {
                count=h[i]/j->first;
                if(count<=j->second)
                {
                    h[i]=h[i]-count*j->first;
                    j->second=j->second-count;
                }
                else
                {
                    if(count>j->second)
                    {
                        h[i]=h[i]-j->second*j->first;
                       j->second=0;
                       break;
                    }
                }
            }
            if(j->second==0)
                break;
            
        }
        if(j->second==0)
          j++;
    }
    cout<<max;
}

int main()
{
    int i,t;
    cin>>t;
    for(i=0;i<t;i++)
    {
        box();
        cout<<endl;
    }
    return 0;
}