#include<bits/stdc++.h>
#define ll long long 
using namespace std;
void solve(){
    long long n,m,k,tot=0,cnt=0;
    cin>>n>>m;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
        tot+=arr[i];
        cnt+=ceil((double)arr[i]/(double)m);
    }
    tot=ceil((double)(tot)/(double)m);
    swap(tot,cnt);
    cout<<cnt<<" "<<tot<<endl;
}
int main()
 {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("bhar.txt", "w", stdout);
    #endif
    long long q(1);cin>>q; 
    while(q--){
        solve();
    }
    return 0;
}