/*
  [BAPC'07] SPLITTING THE LOOT
  by: Jan Kuipers
*/

using namespace std;

#include <iostream>
#include <iomanip>
#include <queue>

int N;
double perc;
double total;
vector<double> part;

int possible (double x) {

  priority_queue<double> p;
  p.push(-x);
  for (int i=0; i<part.size(); i++) p.push(-part[i]);

  while (p.size()>=2) {
    double p1 = p.top(); p.pop();
    double p2 = p.top(); p.pop();
    p.push((p1+p2)/(1-perc/100));
  }

  return -p.top() < total;
}

int main () {

  int runs;
  cin>>runs;
  while (runs--) {
    cin>>total>>perc>>N;
    part=vector<double>(N);
    for (int i=0; i<N; i++) cin>>part[i];

    if (!possible(0)) {
      cout<<-1<<endl;
    }
    else {
      double lo=0, hi=total;
      for (int times=0; times<100; times++) {
	double x = (lo+hi)/2;
	if (possible(x)) lo=x; else hi=x;
      }
      cout<<setprecision(10)<<lo<<endl;
    }    
  }

  return 0;
}
