#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+5;
ll t,n,m,a[N],ans=0,bns=0;
int main(){
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
cin>>t;
while(t--){
ans=0,bns=0;
cin>>n>>m;
ll pre=0;
for(int i=1;i<=n;i++){
cin>>a[i];
ll g=m/a[i];
ll h=m/g;
if(a[i]>=g&&a[i]>=h){
ans+=a[i];
if(a[i]!=g){
pre=0;
}else{
pre=pre;
}
}else if(g>=h){
ans+=g;
if(g==h){
if(pre==0){
bns+=1;
pre=1;
}else if(pre==1){
pre=1;
}else{
pre=2;
}
}else{
if(pre==0){
bns+=1;
pre=1;
}else{
pre=1;
}
}
}else{
ans+=h;
if(pre==0){
bns+=2;
pre=2;
}else if(pre==1){
bns++;
pre=2;
}else{
pre=2;
}
}
}
cout<<ans<<' '<<bns<<'\n';
}
return 0;
}