#include <bits/stdc++.h>
using namespace std;
#define rall(x) x.rbegin(), x.rend()
#define int long long
signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int n, a, M;
        cin >> n >> a >> M;
        vector<int> b(n);
        for (auto& x : b) cin >> x;
        sort(rall(b));
        int ans = 1;
        auto check = [&](int h) {
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                if (b[i] >= h) {
                    tmp += 1 + 2 * h * a;
                } else {
                    tmp += 1 + 2 * a * b[i];
                }
                if (tmp >= M) return 0;
            }
            return 1;
        };
        for (int i = b[0]; i >= 1; i--) {
            if (check(i)) {
                ans = i;
                break;
            }
        }
        cout << ans << endl;
    }
}