#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
void solve() {
  long long n, p, k;
  cin >> n >> p >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort((a).begin(), (a).end());
  long long ans1 = 0, ans2 = 0;
  long long p1 = p;
  long long q = 1;
  while (q < n && p1 >= a[q]) {
    p1 -= a[q];
    ans1 += 2;
    q += 2;
  }
  ans2 = (p >= a[0]);
  p1 = p - a[0];
  q = 2;
  while (q < n && p1 >= a[q]) {
    p1 -= a[q];
    ans2 += 2;
    q += 2;
  }
  cout << max(ans1, ans2) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  cin >> q;
  while (q--) solve();
}
