#include <bits/stdc++.h>
using namespace std;
#define int long long

main() {
    int t;
    cin >> t;
    while (t--) {
        int n, a, M;
        cin >> n >> a >> M;
        vector<int> b(n);
        for (auto& x : b) cin >> x;
        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;
        };
        // int L = 1, R = (M - 1) / (2 * a) + 1;
        int L = 1, R = (M / (2 * a)) + 5; // R =  max(b_i);
        while (R - L > 1) {
            int mid = (L + R) / 2;
            if (check(mid)) {
                L = mid;
            } else {
                R = mid;
            }
        }
        cout << L << endl;
    }
}