#include<iostream>
#include<algorithm>
using namespace std;
#define N 6
#define eps 0.00001
#define REP(i,b,n) for(int i=(int)b;i<(int)n;i++)
#define rep(i,n)  REP(i,0,n)
int gcd(int w,int m){
  return m == 0?w:gcd(m,w%m);
}

/*
double tw=weight[i][k]+weight[k+1][j];
double tmpr = max(weight[i][k]/tw+rcost[k+1][j],rcost[i][k]-weight[k+1][j]/tw);
double tmpl = max(weight[k+1][j]/tw+lcost[i][k],lcost[k+1][j]-weight[i][k]/tw );
double tmp = tmpr+tmpl;
if ( tmp <lim+eps && tmp >cost[i][j]){
*/

double ans = -1;


void solve(int n,int now,bool *used,double *rc,double *lc,double lim,double c,int *weight){
  if ( n-1 == now){
    ans = max(ans,c);
    return;
  }
  
  //left i , right j
  rep(i,n){
    if ( used[i] == true)continue;
    rep(j,n){
      if (i == j)continue;
      if ( used[j] == true)continue;
      double w = weight[i]+weight[j];
      double tmpr=max(weight[i]/w+rc[j],-weight[j]/w+rc[i]);
      double tmpl=max(weight[j]/w+lc[i],-weight[i]/w+lc[j]);

      if ( tmpr+tmpl >lim+eps){continue;}
      double tr=rc[i],tl=lc[i];int tw=weight[i];
      used[j]=true;
      rc[i]=tmpr;
      lc[i]=tmpl;
      weight[i]=weight[i]+weight[j];
      solve(n,now+1,used,rc,lc,lim,tmpr+tmpl,weight);
      rc[i]=tr;
      lc[i]=tl;
      weight[i]=tw;
      used[j]=false;
    }
  }
  
}

int main(){
 int te;
 cin>>te;
 while(te--){
   int n;
   double r;
   cin>>r>>n;
   int inp[n];
   rep(i,n)cin>>inp[i];

   double rc[n],lc[n];
   bool used[n];
   rep(i,n)rc[i]=lc[i]=0,used[i]=false;
   ans=-1;

   solve(n,0,used,rc,lc,r,0,inp);
   if ( ans == -1)puts("-1");
   else printf("%.9lf\n",ans);
 }
}