#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
int main(){
int T;
int x,y,n,i,cnt,flag;
double r[100],sum;
scanf("%d",&T);
while(T--){
cnt=0;flag=1;
scanf("%d%d%d",&x,&y,&n);
for(i=0;i<n;i++){
scanf("%lf",&r[i]);
}
sort(r,r+n);
sum=0;i=n-1;
while(1){
if(2*r[i]<=y){flag=0;break;}
sum+=sqrt(4*r[i]*r[i]-y*y);
cnt++;
i--;
if(sum-x>=0){break;}
if(i==-1){flag=0;break;}
}if(flag){printf("%d\n",cnt);}
else{printf("-1\n");}
}
}