#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int dp[3601];
int main()
{
	int k;
	cin >> k;
	for (int j = 0; j < k; ++j)
	{
		int n;
		cin >> n;
		int t;
		cin >> t;
		vector<int> arr(n);
		for (int i = 0; i < n; ++i)
		{
			cin >> arr[i];
		}
		for (int i = 0;  i <= 3600; ++i)
			dp[i] = -1;
		queue<int> Q;
		Q.push(0);
		dp[0] = 0;
		int ans = 1e9;
		while (!Q.empty())
		{
			int q = Q.front();
			if (q >= t && ans - t > q - t)
			{
				ans = q;
			}
			Q.pop();
			for (int i = 0; i < n; ++i)
			{
				int s = q + arr[i];
				s = max(0, min(s, 3600));
				if (dp[s] == -1)
				{
					dp[s] = dp[q] + 1;
					Q.push(s);
				}
			}
		}
		cout << dp[ans] << " " << ans - t << endl;
	}
	//system ("pause");
	return 0;
}