// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890123456789LL
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
using namespace std;
// mylittledoge
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
for(int t =0; t < T; t++) {
int N,K;
cin >> N >> K;
vector<int> C(N);
for(int i =0; i < N; i++) cin >> C[i];
vector<int> D(3601,1000000);
priority_queue< pair<int,int>, vector< pair<int,int> >, greater< pair<int,int> > > q;
q.push(make_pair(0,0));
D[0] =0;
while(!q.empty()) {
pair<int,int> p =q.top();
q.pop();
if(p.ff != D[p.ss]) continue;
for(int i =0; i < N; i++) if(D[max(0,min(3600,p.ss+C[i]))] > p.ff+1) {
D[max(0,min(3600,p.ss+C[i]))] =p.ff+1;
q.push(make_pair(D[max(0,min(3600,p.ss+C[i]))],max(0,min(3600,p.ss+C[i]))));}
}
for(int i =K; i <= 3600; i++) if(D[i] < 1000000) {
cout << D[i] << " " << i-K << "\n";
break;}
}
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxxdWV1ZT4KI2luY2x1ZGUgPHN0YWNrPgojaW5j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