#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
const double PI=acos(-1.0);
const double eps=0.00001;
int main(){
int cs;
scanf("%d",&cs);
int n,k;
while(cs--){
scanf("%d%d",&n,&k);
double left=0.0,right=0.0;
int i;
double arr[10001];
for(i=0;i<n;i++){
scanf("%lf",&arr[i]);
arr[i]=arr[i]*arr[i];
right+=arr[i];
}
++k;
right=right/k;
double mid;
int ans;
while((right-left)>eps){
ans=0;
mid=(right+left)/2;
for(i=0;i<n;i++){
if(mid<arr[i])
ans+=int(arr[i]/mid);
}
if(ans>=k)
left=mid+eps;
else
right=mid-eps;
}
printf("%.4lf\n",(right+left)/2*PI);
}
return 0;
}
慕容森
相关分类