#include <vector>
#include <queue>
#include <iostream>
#include <iomanip>
using namespace std;

// Calculates how much gold is needed to construct the given parts.
double needed(const vector<double> &parts, double f)
{
    priority_queue<double, vector<double>, greater<double> >
        pq(parts.begin(), parts.end());
    while(pq.size() > 1)
    {
        double a = pq.top(); pq.pop();
        double b = pq.top(); pq.pop();
        pq.push((a + b)/f);
    }
    return pq.top();
}

int main()
{
    int cases;
    cin >> cases;
    while(cases--)
    {
        // Read input
        int W, P, N;
        cin >> W >> P >> N;
        vector<double> parts(1);
        for(int n = 0; n < N; ++n)
        {
            int i;
            cin >> i;
            parts.push_back(i);
        }
        const double f = (1.0 - P/100.0);

        // Binary search for the size of my piece
        double lo = -1, hi = W;
        for(int pass = 0; pass < 50; ++pass)
        {
            parts[0] = (lo + hi)/2;
            if(needed(parts, f) < W)
                lo = parts[0];
            else
                hi = parts[0];
        }

	cout << showpoint << setprecision(15);
        if(lo > 0)
        {
            // Everyone gets a piece; output mine
            cout << lo << endl;
        }
        else
        {
            // In this case, either:
            //  - I have enough gold to satisfy my accomplices, but can't make
            //    an extra cut to get a part myself => output 0
            //  - I don't have enough gold to satisfy my accomplices, even if
            //    I don't take a piece myself => output -1
            parts.erase(parts.begin());
            cout << (needed(parts, f) < W + 1e-9 ? 0.0 : -1.0) << endl;
        }
    }
}
