#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, pr, k;
    cin >> n >> pr >> k;
    vector<int> vec(n);
    for (int i = 0; i < n; i++) cin >> vec[i];
    sort(vec.begin(), vec.end());
    int cnt = 0, prv = pr;
    int maxi = 0;
    for (int i = 0; i < n; i += 2) {
      if (vec[i] <= pr) {
        if (!i)
          cnt++;
        else
          cnt += 2;
        pr -= vec[i];
      }
    }
    maxi = cnt;
    pr = prv;
    cnt = 0;
    for (int i = 1; i < n; i += 2) {
      if (vec[i] <= pr) cnt += 2, pr -= vec[i];
    }
    maxi = max(maxi, cnt);
    cout << maxi << endl;
  }
}
