#include<bits/stdc++.h>
using namespace std;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi acos(-1.0)
#define test int t; cin>>t; while(t--)
#define en '\n'
#define Y  cout<<"YES"<<en;
#define N  cout<<"NO"<<en;
int main()
{
    test
    {
        int i,j,n,m,x;
        cin>>n>>x;
        long long int s1=0,s2=0,mx=0;
        for(i=0; i<n; i++)
        {
            cin>>m;
            if(m%x==0) s1+=m;
            else s2+=m;
            mx+=ceil((1.0*m)/x);
        }
        long long int s=s1/x+ceil((s2*1.0)/x);
        cout<<s<<" "<<mx<<endl;
    }
    return 0;
}




