#include<iostream>
using namespace std;

//first place to start point
//second place to end point
//each value means stacked sum
double stackSequence[1000][1000] = { 0 };
int cost[1000] = { 0 };
double ans[50] = { 0 };

double getLeasetValue(int* cost, int numofdays, int numofteams)
{
	//save all possible value in array
	for (int i = 0; i < numofdays - numofteams+1; i++)
	{
		stackSequence[i][i] = cost[i];
		for (int j = i; j < numofdays; j++)
		{
			if (cost[j + 1] == 0)
				break;
			stackSequence[i][j + 1] = stackSequence[i][j] + cost[j + 1];
		}
	}

	//get least value from array in this variable
	double leastvalue = stackSequence[0][numofteams - 1] / numofteams;

	for (int i = 0; i < numofdays - numofteams; i++)
	{
		double temp = 0;
		for (int j = i + numofteams; j < numofdays; j++)
		{
			temp = stackSequence[i][j] / (j - i + 1);
			if (leastvalue > temp)
				leastvalue = temp;
		}
	}

	return leastvalue;

}


int main()
{
	int testcasenum = 0;
	if (testcasenum < 50)
	{
		cin >> testcasenum;
		for (int i = 0; i < testcasenum; i++)
		{
			int n = 0; //numofdays
			int m = 0; //numofteams
			cin >> n >> m;
		
			if (n <= 0 || n > 1000)
			{
				cout << "대여할 수 있는 날은 1일 이상 1000일 이하여야 합니다" << endl;
				exit(1);
			}

			if (m > n || m <= 0 || m > 1000)
			{
				cout << "섭외한 공연 팀의 수는 대여할 수 있는 날보다 적어야 하고 1팀 이상 1000팀 이하여야 합니다" << endl;
				exit(1);
			}

			for (int i = 0; i < n; i++)
			{
				cin >> cost[i];
			}


			//set sequence value by func and get least sequence value
			ans[i] = getLeasetValue(cost, n, m);
			int temp1 = ans[i];
		}

		for (int i = 0; i < testcasenum; i++)
		{
			printf("%.8lf\n", ans[i]);
		}
	}

	int hi;
	cin >> hi;
	return 0;
}

