# Pie[二分]

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<bitset>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<vector>
#include<cstdlib>
#include<list>
#include<stack>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long LL;
void debug() {cout << "ok running!" << endl;}
const double PI = acos(-1.0);
int n, m;
double a[10005];
bool check(double x)
{
int sum = 0;
for(int i = 0; i < n; ++i)
sum += (int)(a[i]/x);
if(sum >= m)
return 1;
else return 0;
}
int main()
{
ios::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif // ONLINE_JUDGE
int t;
cin >> t;
while(t--)
{
cin >> n >> m;
m++;
for(int i = 0; i < n; ++i)
{
int x;
cin >> x;
a[i] = x*x*PI;
}
//cout << a[0] << endl;
double l = 0, r = 10005*10005*PI;
double ans = -1;
while(r - l > 0.000001)
{
//cout << l << " " << r << endl;
double mid = (l+r)/2;
//cout << mid << endl;
if(check(mid))
{
ans = mid;
l = mid;
}
else r = mid;
}
ios::fixed;
//cout << ans << endl;
cout << fixed << setprecision(4) << ans << endl;
}
return 0;
}