using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace CsharpSpiral {
    partial class Program {
        static void Main(string[] args) {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true };
            Console.SetOut(sw);
            new Program().Solve(new ConsoleInput(Console.In, ' '));
            Console.Out.Flush();
        }
        public void Solve(ConsoleInput cin) {
            var P = cin.ReadIntArray(2);
            var N = P[0];var K = P[1];
            P = cin.ReadIntArray(N);
            var maxima = new long[N];
            maxima[0] = (P[0] + 1);
            for(int i = 1; i < N; i++) {
                maxima[i] = maxima[i - 1] + (P[i] + 1);
                if(i >= K)
                    maxima[i] -= P[i - K]+1;
            }
            double res = maxima.Skip(K - 1).Max();
            Console.WriteLine(res / 2);
        }
    }

    class PriorityQueue<T> where T: IComparable<T> {
        List<T> body = new List<T>();
        bool isRootMaximum { get; }
        public PriorityQueue(bool maxTop = true) { isRootMaximum = maxTop; }
        //suppose Me>Her if isRootMaximum
        int Compare(T Me, T Her) => isRootMaximum ? Me.CompareTo(Her) : -(Me.CompareTo(Her));
        int Compare(int x, int y) => Compare(body[x], body[y]);
        void Swap(int x, int y) { T tmp = body[x]; body[x] = body[y]; body[y] = tmp; }
        public void Push(T elem) {
            body.Add(elem);
            //the parent of n-th element is the ((n+1)>>1)-1-th
            int j = lastIndex;
            while(j > 0) {
                int parent = ((j + 1) >> 1) - 1;
                if(Compare(parent, j) < 0)
                    Swap(parent, j);
                else break;
                j = parent;
            }
        }
        public T Pop() {
            T top = body[0];
            Swap(0, lastIndex);
            body.RemoveAt(lastIndex);
            var newComer = 0;
            while(newComer < length) {
                var leftChild = ((newComer + 1) << 1) - 1;
                if(leftChild >= length) break;
                var toSwap = leftChild;
                var rightChild = leftChild + 1;
                if(rightChild < length && Compare(leftChild, rightChild) < 0)
                    toSwap = rightChild;
                if(Compare(newComer, toSwap) < 0)
                    Swap(toSwap, newComer);
                else break;
                newComer = toSwap;
            }
            return top;
        }
        T Top { get { return body[0]; } }
        int length { get { return body.Count(); } }
        int lastIndex{ get { return body.Count() - 1; } }
        public string Emit() { return body.ToArray().Join(","); }
    }

    static class ExtendClass {
        public static void Swap<T>(this T[] X, int i, int j) {
            T tmp = X[i];
            X[i] = X[j];
            X[j] = tmp;
        }
        public static string Join<T>(this T[] X, string separator = " ") => string.Join(separator, X);
        public static S[] Clone<S>(this S[] src) where S : struct {
            var res = new S[src.Length];
            Array.Copy(src, res, src.Length);
            return res;
        }
    }

    class ConsoleInput {
        private readonly TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(TextReader stream, char separator = ' ') {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read {
            get {
                if(inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for(int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) {
            var ret = new string[N];
            for(long i = 0; i < N; ++i)
                ret[i] = Read;
            return ret;
        }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 34652