#include <iostream>
#include <fstream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <ctime>
#include <cstdlib>

using namespace std;

#define sz(x) ((int)((x).size()))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const double EPS = 1e-9;
const double PI = acos(-1.0);

void update(int &x, int y) {
	if (x == -1 || x > y)
		x = y;
}

int n, t, b[50];
int dp[10500];

void solve() {
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++) {
		scanf("%d", &b[i]);
	}
	sort(b, b + n);
	reverse(b, b + n);
	for (int i = 0; i < 10500; i++) {
		dp[i] = -1;
	}
	dp[0] = 0;
	for (int i = 0; i < n; i++) {
		if (b[i] > 0) {
			for (int j = 0; j < 10500 - b[i]; j++) {
				if (dp[j] != -1) {
					update(dp[j + b[i]], dp[j] + 1);
				}
			}
		} else {
			for (int j = 10500 - 1; j + b[i] >= 0; --j) {
				if (dp[j] != -1) {
					update(dp[j + b[i]], dp[j] + 1);
				}
			}
		}
	}
	int bst = t;
	while (dp[bst] == -1) {
		bst++;
	}
	printf("%d %d\n", dp[bst], min(bst, 3600) - t);
}

int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

	int T;
	scanf("%d", &T);
	while (T-- > 0) {
		solve();
	}

	return 0;
}
