/*
       shool : Cu Chi High School
       participant : Ngo Quoc Binh
*/
#include <bits/stdc++.h>
using namespace std;

#define debug(x) cerr << #x << " = " << x << "\n";
#define vdebug(a) cerr << #a << " = "; for(auto x : a) cout << x << " "; cout << "\n";
#define TIME cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define hashmap unordered_map
#define hashset unordered_set
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rev(x) reverse(all(x))
#define sz(x) ((int)((x).size()))
#define max_arr(x) *max_element(all(x))
#define min_arr(x) *min_element(all(x))

#define pb push_back
#define pf push_front
#define PB pop_back
#define PF pop_front
#define en '\n'
#define ff first
#define ss second
#define task "wtf"

using ll = long long;
using ull = unsigned long long;
using ld = long double;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve()
{
        int t;
        cin >> t;
        int ans = 1e9;
        while(t--)
        {
                ans = 1e9;
                int n,u,m;
                cin >> n >> u >> m;

                vector<ll> a(n);
                for(int i = 0 ; i < n ; i++) cin >> a[i];

                ll sum = accumulate(all(a),0);
                bitset<1000005> dp;
                dp[0] = 1;
                for(int i = 0 ; i < n ; i++)
                {
                        dp |= (dp << a[i]);
                }

                for(int i = 0 ; i <= sum ; i++)
                {
                        if(dp[i])
                        {
                                int j = sum - i;
                                int a = (i + u - 1)/u, b = (j + m - 1)/m;

                                ans = min(ans, max(a, b));
                        }
                }

                cout << ans << endl;
        }

}

int main()
{
        fastIO

        solve();

        return 0;
}
