#include <cstdio>
#include <iostream>
#include <stack>
#include <iostream>
#include <vector>
#include<queue>
using namespace std;

int a[20];
int d[3605];
bool u[3605];

int main()
{

	int t;
	scanf("%d", &t);

	for(int tt = 0; tt < t ;tt++)
	{
		int n, tm;
		scanf("%d%d", &n, &tm);

		memset(u, 0, sizeof(u));
		memset(d, -1, sizeof(d));

		for(int i = 0; i < n; i++)
			scanf("%d", &a[i]);

		queue<int> q;
		q.push(0);
		d[0] = 0;
		u[0] = 1;
		while(q.size() > 0)
		{
			int v = q.front(); q.pop();
			for(int i =0 ;i  < n; i++)
			{
				int to = max(0, min(v + a[i], 3600));
				if(!u[to])
				{
					u[to] = 1;
					d[to] = d[v] + 1;
					q.push(to);
				}
			}
		}
		int cnt = 0, ma = 0;
		for(int i = 3600; i >= tm; i--)
			if(u[i])
				cnt = d[i], ma = i - tm;
		printf("%d %d\n", cnt, ma);
	}

	return 0;
}