#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, p, k;
    cin >> n >> p >> k;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    for (long long int i = 2; i < n; i++) {
      arr[i] = arr[i - 2] + arr[i];
    }
    long long int ans = upper_bound(arr, arr + n, p) - arr;
    cout << ans << endl;
  }
}
