# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, k = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    a = [(x+1)*x//2/x for x in p]
    ans = 0
    sm = 0
    for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
    print(ans)



    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""



""" import sys sys from collections import deque, defaultdict from math import sqrt, factorial def solve():
    n, k = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    a = [(x+1)*x//2/x for x in p]
    ans = 0
    sm = 0
    for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
    print(ans)



     solve int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x n, k = [int(x) for x in input().split()] n [int(x) for x in input().split()] k int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x p = [int(x) for x in input().split()] p [int(x) for x in input().split()] (x+1)*x//2/x for x in p for x in p x p for x in p (x+1)*x//2/x (x+1)*x//2 (x+1)*x x+1 x 1 x 2 x a = [(x+1)*x//2/x for x in p] a [(x+1)*x//2/x for x in p] ans = 0 ans 0 sm = 0 sm 0 for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
     i range(n) range n sm += a[i] sm a[i] a i if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
     i + 1 >= k i + 1 i 1 k ans = max(ans, sm) ans max(ans, sm) max ans sm sm -= a[i - k + 1] sm a[i - k + 1] a i - k + 1 i - k i k 1 print(ans) print ans t = 1 t 1 for case in range(1,t+1):
    ans = solve() case range(1,t+1) range 1 t+1 t 1 ans = solve() ans solve() solve """



""" def solve():
    n, k = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    a = [(x+1)*x//2/x for x in p]
    ans = 0
    sm = 0
    for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
    print(ans)



     def solve():
    n, k = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    a = [(x+1)*x//2/x for x in p]
    ans = 0
    sm = 0
    for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
    print(ans)



     solve t = 1 1 t ans = solve() solve() ans
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, k = [int(x) for x in input().split()]
    p = [int(x) for x in input().split()]
    a = [(x+1)*x//2/x for x in p]
    ans = 0
    sm = 0
    for i in range(n):
        sm += a[i]
        if i + 1 >= k:
            ans = max(ans, sm)
            sm -= a[i - k + 1]
    print(ans)



    

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""



"""
