import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)

N,K = mint()
p = lint()

ans = sum(p[:K])
tmp = ans
for i in range(K,N):
    tmp = tmp-p[i-K]+p[i]
    ans = max(ans,tmp)
print((ans+K)/2) import sys sys from sys import exit from collections import deque from bisect import bisect_left, bisect_right, insort_left, insort_right from heapq import heapify, heappop, heappush from math import * sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 INF = 10**20 INF 10**20 10 20 eps = 1.0e-20 eps 1.0e-20 MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 def mint():
    return map(int,input().split()) mint return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def lint():
    return list(map(int,input().split())) lint return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def ilint():
    return int(input()), list(map(int,input().split())) ilint return int(input()), list(map(int,input().split())) return int(input()), list(map(int,input().split())) int(input()) int input() input list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) judge print(l[0] if x else l[1]) print l[0] if x else l[1] x l[0] l 0 l[1] l 1 x x l=['Yes', 'No'] l ['Yes', 'No'] 'Yes' 'No' def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) lprint for x in l:
        print(x, end=sep) x l print(x, end=sep) print x end=sep end sep l l sep='\n' sep '\n' N,K = mint() N mint() mint K p = lint() p lint() lint ans = sum(p[:K]) ans sum(p[:K]) sum p[:K] p :K K tmp = ans tmp ans for i in range(K,N):
    tmp = tmp-p[i-K]+p[i]
    ans = max(ans,tmp) i range(K,N) range K N tmp = tmp-p[i-K]+p[i] tmp tmp-p[i-K]+p[i] tmp-p[i-K] tmp p[i-K] p i-K i K p[i] p i ans = max(ans,tmp) ans max(ans,tmp) max ans tmp print((ans+K)/2) print (ans+K)/2 ans+K ans K 2 MOD = 10**9+7 10**9+7 MOD def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1]) judge def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep) lprint ans = max(ans,tmp) max(ans,tmp) ans INF = 10**20 10**20 INF p = lint() lint() p K = mint() mint() K def ilint():
    return int(input()), list(map(int,input().split())) def ilint():
    return int(input()), list(map(int,input().split())) ilint ans = sum(p[:K]) sum(p[:K]) ans tmp = ans ans tmp def mint():
    return map(int,input().split()) def mint():
    return map(int,input().split()) mint N,K = mint() mint() N eps = 1.0e-20 1.0e-20 eps def lint():
    return list(map(int,input().split())) def lint():
    return list(map(int,input().split())) lint tmp = tmp-p[i-K]+p[i] tmp-p[i-K]+p[i] tmp
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)

N,K = mint()
p = lint()

ans = sum(p[:K])
tmp = ans
for i in range(K,N):
    tmp = tmp-p[i-K]+p[i]
    ans = max(ans,tmp)
print((ans+K)/2)