module app;

import core.bitop;

import std.algorithm;
import std.array;
import std.bigint;
import std.conv;
import std.stdio;
import std.string;

struct Input
{
	int n, k;
	int[] p;
}

void parseInput(T)(out Input input, T file)
{
	with (file) with (input)
	{
		auto array = readln().strip().split();
		n = array[0].to!int;
		k = array[1].to!int;
        p = readln().strip().split().map!(to!int).array();
	}
}

struct Output
{
}

auto main2(Input* input)
{
    int max = sum(input.p[0..input.k]);
    int prev = max;
    int i = input.k;
    while (i < input.n)
    {
        int current = prev - input.p[i - input.k] + input.p[i];
        if (current > max)
            max = current;
        prev = current;
        i++;
    }

	return (cast(real)(max + input.k)) / 2.0;
}

unittest { writeln("begin unittest"); }

unittest // example1
{
	string example =
`5 3
1 2 2 4 5`;
	Input input = void;
	parseExample(input, example);
	auto result = main2(&input);
	writeln(result);
	assert(result == 7.000000000000);
}

unittest // example2
{
	string example =
`4 1
6 6 6 6`;
	Input input = void;
	parseExample(input, example);
	auto result = main2(&input);
	writeln(result);
	assert(result == 3.500000000000);
}

unittest // example3
{
	string example =
`10 4
17 13 13 12 15 20 10 13 17 11`;
	Input input = void;
	parseExample(input, example);
	auto result = main2(&input);
	writeln(result);
	assert(result == 32.000000000000);
}

unittest { writeln("end unittest"); }

void parseExample(out Input input, string example)
{
	struct Adapter
	{
		string[] _lines;
		this(string input) { _lines = input.splitLines(); }
		string readln() { auto line = _lines[0]; _lines = _lines[1..$]; return line; }
	}
	parseInput(input, Adapter(example));
}

void main()
{
	Input input = void;
	parseInput(input, stdin);
	auto result = main2(&input);
	writeln(result);
}
