록 페스티벌


import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.io.BufferedWriter;

import java.io.OutputStreamWriter;


public class Main {


    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    static BufferedWriter bw =new BufferedWriter(new OutputStreamWriter(System.out));

    static int t, l, n;

    static double num[], ans;


public static void main(String[] args) throws Exception {

t = Integer.parseInt(br.readLine());

for (int i=0; i<t; i++) {

String[] s = br.readLine().split(" ");

n = Integer.parseInt(s[0]);

l = Integer.parseInt(s[1]);

num = new double[n];

s = br.readLine().split(" ");

for (int j=0; j<n; j++)

num[j] = Double.parseDouble(s[j]); // 입력

ans = 99999; // 안 나올 수 저장

int roop = n - l + 1; // 전체 도는 횟수

for (int j=roop; j>=1; j--) {

int loop = l; 

for (int k=0; k<j; k++) {

double sum = 0;

int cnt = k;

while(cnt < loop) {

sum += num[cnt++];

}

loop++;

sum /= l;

if (sum < ans) // 매번 비교해서 평균 최고 낮은 거 구함

ans = sum;

}

l++;

}

String num = String.format("%.10f", ans);

bw.write(num + "");

bw.newLine();

}

bw.close();

}

}