#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

// debug
//vector<pair<int, int> > picks;

int main() {

	//freopen("input.txt", "r", stdin);

	int t;
	cin >> t;
	for (int t0 = 0; t0 < t; ++t0)
	{
		int n, L;
		cin >> n >> L;
		vector <int> a(n);
		for (int i = 0; i < n; ++i)
		{
			cin >> a[i];
		}
		
		vector <int> q(1, 0);
		vector <int> d(3601, -1);
		d[0] = 0;
		int v;
		for(int i = 0; i != q.size(); ++i)
		{
			for (int j = 0; j < n; ++j)
			{
				v = q[i] + a[j];
				v = max(0, v);
				v = min(3600, v);
				if (d[v] == -1)
				{
					d[v] = d[q[i]] + 1;
					q.push_back(v);
				}
			}
		}
		int ans = 100000;
		for (int i = L; i <= 3600; ++i)
		{			
			if (d[i] != -1)
			{
				ans = i;
				break;
			}
		}
		cout << d[ans] <<' ' << ans - L << endl;

	}



	return 0;
}