#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cstring>
using namespace std;

const int maxn = 4000;
int d[maxn], qu[maxn], ch[maxn];
int MN = 0;
int MX = 3600;


void solve()
{
	int n, t;
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++)
		scanf("%d", &ch[i] );
	memset(d, -1, sizeof d);
	d[0] = 0;
	int l = 0, r = 0;
	qu[r++] = 0;
	while (l < r)
	{
		int x = qu[l++];
		int cd = d[x];
		for (int i = 0; i < n; i++)
		{
			int nx = x + ch[i];
			nx = max(nx, MN);
			nx = min(nx, MX);
			if (d[nx] == -1)
			{
				d[nx] = cd + 1;
				qu[r++] = nx;
			}
		}
	}
	for (int i = t; ;i++)
	{
		if (d[i] == -1)
			continue;
		printf("%d %d\n", d[i], i - t);
		break;
	}
}


int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		solve();
	return 0;
}