#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, p, k, i, x;
    cin >> n >> p >> k;
    vector<long long> a;
    for (i = 0; i < n; i++) {
      cin >> x;
      a.push_back(x);
    }
    sort(a.begin(), a.end());
    long long cnt1 = 0, cnt2 = 0;
    long long m = p;
    for (i = 1; i < n; i += 2) {
      if (a[i] <= p) {
        p -= a[i];
        cnt1 += 2;
      } else
        break;
    }
    for (i = 2; i < n; i += 2) {
      if (a[i] <= m) {
        m -= a[i];
        cnt2 += 2;
      } else
        break;
    }
    if (a[0] <= m) cnt2++;
    cout << max(cnt1, cnt2) << "\n";
  }
}
