#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, p, k;
  cin >> n >> p >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  int x = 0, y = 0;
  int a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      x += v[i];
      if (x <= p) a++;
    } else {
      y += v[i];
      if (y <= p) b++;
    }
  }
  a = a * 2 - 1;
  b = b * 2;
  if (a > b)
    cout << a << endl;
  else
    cout << b << endl;
}
signed main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
