#define _USE_MATH_DEFINES

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <cassert>
#include <stack>
#include <cstdlib>
#include <bitset>
#include <cmath>

#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define pb push_back
#define all(a) a.begin(),a.end()
#define sz(a) int(a.size())
#define mp make_pair

using namespace std;

typedef long long li;
typedef long double ld;

typedef pair<int,int> pt;
#define ft first
#define sc second

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

//#define TASK_NAME ""

const int N = 20;
int n, t, d[N];

bool read() {
	if (!(cin >> n >> t))
		return false;
	forn(i, n)
		cin >> d[i];
	return true;
}

int dist[3601];

void solve() {
	forn(i, 3601)
		dist[i] = -1;

	dist[0] = 0;

	queue <int> q;
	q.push(0);

	int best = 3600;

	while (!q.empty()) {
		int v = q.front(); q.pop();

		forn(i, n) {
			int nv = min(max(v + d[i], 0), 3600);
			if (dist[nv] == -1) {
				dist[nv] = dist[v] + 1;
				if (nv >= t && nv < best)
					best = nv;
				q.push(nv);
			}
		}
	}

	cout << dist[best] << " " << best - t << endl;


}

int main() {
#ifdef TASK_NAME
	freopen(TASK_NAME ".in", "r", stdin);
	freopen(TASK_NAME ".out", "w", stdout);
#endif

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif

	int t;
	cin >> t;

	while (read())
		solve();

	return 0;
}