import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
P = inpl()

ave = []
for p in P:
    ave.append((p+1)/2)
    
pre = sum(ave[:k])
ans = pre
for i in range(1,n-k+1):
    now = pre - ave[i - 1] + ave[i + k - 1]
    pre = now
    ans = max(ans,now)

print(ans) import sys, bisect, math, itertools, string, queue, copy sys bisect math itertools string queue copy def inp(): return int(input()) inp def inpm(): return map(int,input().split()) inpm def inpl(): return list(map(int, input().split())) inpl def inpls(): return list(input().split()) inpls def inplm(n): return list(int(input()) for _ in range(n)) inplm n n list(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input()) list input() input def inplL(n): return [list(input()) for _ in range(n)] inplL n n tuple(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) tuple(input()) tuple input() input def inplT(n): return [tuple(input()) for _ in range(n)] inplT n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def inpll(n): return [list(map(int, input().split())) for _ in range(n)] inpll n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) inplls n n n,k = inpm() n inpm() inpm k P = inpl() P inpl() inpl ave = [] ave [] for p in P:
    ave.append((p+1)/2)
     p P ave.append((p+1)/2) ave.append ave append (p+1)/2 p+1 p 1 2 pre = sum(ave[:k]) pre sum(ave[:k]) sum ave[:k] ave :k k ans = pre ans pre for i in range(1,n-k+1):
    now = pre - ave[i - 1] + ave[i + k - 1]
    pre = now
    ans = max(ans,now) i range(1,n-k+1) range 1 n-k+1 n-k n k 1 now = pre - ave[i - 1] + ave[i + k - 1] now pre - ave[i - 1] + ave[i + k - 1] pre - ave[i - 1] pre ave[i - 1] ave i - 1 i 1 ave[i + k - 1] ave i + k - 1 i + k i k 1 pre = now pre now ans = max(ans,now) ans max(ans,now) max ans now print(ans) print ans def inpl(): return list(map(int, input().split())) def inpl(): return list(map(int, input().split())) inpl P = inpl() inpl() P pre = sum(ave[:k]) sum(ave[:k]) pre def inplL(n): return [list(input()) for _ in range(n)] def inplL(n): return [list(input()) for _ in range(n)] inplL ans = pre pre ans def inpm(): return map(int,input().split()) def inpm(): return map(int,input().split()) inpm n,k = inpm() inpm() n now = pre - ave[i - 1] + ave[i + k - 1] pre - ave[i - 1] + ave[i + k - 1] now def inplm(n): return list(int(input()) for _ in range(n)) def inplm(n): return list(int(input()) for _ in range(n)) inplm pre = now now pre ave = [] [] ave k = inpm() inpm() k def inplT(n): return [tuple(input()) for _ in range(n)] def inplT(n): return [tuple(input()) for _ in range(n)] inplT def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) inplls ans = max(ans,now) max(ans,now) ans def inpls(): return list(input().split()) def inpls(): return list(input().split()) inpls def inp(): return int(input()) def inp(): return int(input()) inp def inpll(n): return [list(map(int, input().split())) for _ in range(n)] def inpll(n): return [list(map(int, input().split())) for _ in range(n)] inpll
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,k = inpm()
P = inpl()

ave = []
for p in P:
    ave.append((p+1)/2)
    
pre = sum(ave[:k])
ans = pre
for i in range(1,n-k+1):
    now = pre - ave[i - 1] + ave[i + k - 1]
    pre = now
    ans = max(ans,now)

print(ans)