#include <iostream>
using namespace std;
double min_cost = 0;
int N, L; //N: 공연장을 빌릴 수 있는 날, L: 섭외한 공연팀의 수
int * arr; //날마다 생기는 비용(동적할당)
//문제 해결을 위한 재귀 함수
void solution(int cur, int cnt) //cur: 현재 배열의 위치, cnt: 추가적으로 더하는 수치
{
double temp = 0;
for(int i = cur; i < L + cnt; i++)
temp += arr[i];
temp /= (L + cnt) - cur; //날마다 발생하는 평균 계산
if(min_cost > temp)
min_cost = temp;
if(L + cnt < N) //더할 수 있는 범위가 남아있다면
solution(cur, cnt + 1);
else if(cur < N - L) //추가적으로 탐색이 가능하다면
solution(cur + 1, cur + 1);
}
int main(void)
{
cout.setf(ios::fixed); //소수점 자리 고정
cout.precision(11); //소수점 이하의 갯수를 11자리로 설정
int C; //테스트 케이스 횟수
cin >> C;
while(C--)
{
cin >> N >> L;
arr = new int[N];
for(int i = 0; i < N; i++) //날마다 비용 입력
{
cin >> arr[i];
min_cost += arr[i]; //최대한 큰 값으로 만들기 위해
}
solution(0, 0);
cout << min_cost << endl;
delete [] arr;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmRvdWJsZSBtaW5fY29zdCA9IDA7CmludCBOLCBMOyAgICAgICAgICAgICAgIC8vTjog6rO17Jew7J6l7J2EIOu5jOumtCDsiJgg7J6I64qUIOuCoCwgTDog7ISt7Jm47ZWcIOqzteyXsO2MgOydmCDsiJgKaW50ICogYXJyOyAgICAgICAgICAgICAgLy/rgqDrp4jri6Qg7IOd6riw64qUIOu5hOyaqSjrj5nsoIHtlaDri7kpCgovL+usuOygnCDtlbTqsrDsnYQg7JyE7ZWcIOyerOq3gCDtlajsiJgKdm9pZCBzb2x1dGlvbihpbnQgY3VyLCBpbnQgY250KSAgICAgLy9jdXI6IO2YhOyerCDrsLDsl7TsnZgg7JyE7LmYLCBjbnQ6IOy2lOqwgOyggeycvOuhnCDrjZTtlZjripQg7IiY7LmYCnsKICAgIGRvdWJsZSB0ZW1wID0gMDsKICAgIGZvcihpbnQgaSA9IGN1cjsgaSA8IEwgKyBjbnQ7IGkrKykKICAgICAgICB0ZW1wICs9IGFycltpXTsKICAgIAogICAgdGVtcCAvPSAoTCArIGNudCkgLSBjdXI7ICAgICAgICAvL+uCoOuniOuLpCDrsJzsg53tlZjripQg7Y+J6regIOqzhOyCsAogICAgCiAgICBpZihtaW5fY29zdCA+IHRlbXApCiAgICAgICAgbWluX2Nvc3QgPSB0ZW1wOwogICAgCiAgICBpZihMICsgY250IDwgTikgICAgICAgICAvL+uNlO2VoCDsiJgg7J6I64qUIOuylOychOqwgCDrgqjslYTsnojri6TrqbQKICAgICAgICBzb2x1dGlvbihjdXIsIGNudCArIDEpOwogICAgZWxzZSBpZihjdXIgPCBOIC0gTCkgICAgLy/stpTqsIDsoIHsnLzroZwg7YOQ7IOJ7J20IOqwgOuKpe2VmOuLpOuptAogICAgICAgIHNvbHV0aW9uKGN1ciArIDEsIGN1ciArIDEpOwp9CgppbnQgbWFpbih2b2lkKQp7CiAgICBjb3V0LnNldGYoaW9zOjpmaXhlZCk7ICAvL+yGjOyImOygkCDsnpDrpqwg6rOg7KCVCiAgICBjb3V0LnByZWNpc2lvbigxMSk7ICAgICAvL+yGjOyImOygkCDsnbTtlZjsnZgg6rCv7IiY66W8IDEx7J6Q66as66GcIOyEpOyglQogICAgCiAgICBpbnQgQzsgICAgICAvL+2FjOyKpO2KuCDsvIDsnbTsiqQg7Zqf7IiYCiAgICBjaW4gPj4gQzsKICAgIAogICAgd2hpbGUoQy0tKQogICAgewogICAgICAgIGNpbiA+PiBOID4+IEw7CiAgICAgICAgYXJyID0gbmV3IGludFtOXTsKICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSAgICAgIC8v64Kg66eI64ukIOu5hOyaqSDsnoXroKUKICAgICAgICB7CiAgICAgICAgICAgIGNpbiA+PiBhcnJbaV07CiAgICAgICAgICAgIG1pbl9jb3N0ICs9IGFycltpXTsgICAgICAgICAvL+y1nOuMgO2VnCDtgbAg6rCS7Jy866GcIOunjOuTpOq4sCDsnITtlbQKICAgICAgICB9CiAgICAgICAgc29sdXRpb24oMCwgMCk7CiAgICAgICAgCiAgICAgICAgY291dCA8PCBtaW5fY29zdCA8PCBlbmRsOwogICAgICAgIGRlbGV0ZSBbXSBhcnI7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=