#include<bits/stdc++.h>
using namespace std;
long long m,n,t,ans,x,res;
int main()
{
	cin>>t;
	while(t--)
	{
		scanf("%lld%lld",&n,&m);
		ans=0;res=0;
		for(int i=1;i<=n;i++)
		{
			scanf("%lld",&x);
			ans+=x;
			res+=x/m;
			if(x%m!=0) res++;
		}
		printf("%lld %lld\n",(ans/m+((ans%m)!=0)),res);
	}
 } 