#ifdef SU1
#define _GLIBCXX_DEBUG
#endif

#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdio>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forl(i, n) for (int i = 1; i <= int(n); i++)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int i = int(l); i <= int(r); i++)
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define sz(a) (int) (a).size()
#define all(a) (a).begin(), (a).end()
#define ft first
#define sc second
#define x first
#define y second

template<typename X> inline X abs(const X& a) { return a < 0 ? -a : a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld PI = acosl(ld(-1));
const ld EPS = 1e-9;

const int N = 10 * 1000 + 13;
const int SHIFT = N / 2;

const int M = 16 + 3;

int n, t;
int a[M];

inline bool read()
{
	if (scanf("%d%d", &n, &t) != 2) return false;
	
	forn(i, n) assert(scanf("%d", &a[i]) == 1);
	
	return true;
}

int d[N];

inline void solve()
{
	queue<int> q;
	memset(d, 63, sizeof d);
	
	q.push(SHIFT);
	d[SHIFT] = 0;
	
	while (!q.empty())
	{
		int v = q.front(); q.pop();
		
		forn(i, n)
		{
			int nv = v + a[i];
			if (nv < 0 || nv >= N) continue;

			if (d[nv] > d[v] + 1)
			{
				d[nv] = d[v] + 1;
				q.push(nv);
			}	
		}
	}
	
	forn(i, N)
	{
		int x = i - SHIFT;
		if (x >= 3600)
			d[3600 + SHIFT] = min(d[3600 + SHIFT], d[i]);
	}
	
	fore(i, SHIFT, N - 1)
	{
		if (d[i] > INF / 2) continue;
		int x = min(3600, i - SHIFT);
		
		if (x >= t)
		{
			cout << d[i] << ' ' << x - t << endl;
			return;
		}
	}
	
	throw;
}

int main()
{
#ifdef SU1
	assert(freopen("input.txt", "rt", stdin));
//	assert(freopen("output.txt", "wt", stdout));
#endif

	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(5);
	
	int T;
	cin >> T;

	forn(t, T)
	{
		assert(read());
		solve();
	}
	
#ifdef SU1
	cerr << "=== TIME : " << clock() << " ===" << endl;
#endif
	return 0;
}
