n,k = list(map(int,input().split()))

P = list([int(x) + 1 for x in input().split()])

s = [0] * (n+1)

for i in range(n):

    s[i+1] = s[i] + P[i]

res = 0

for i in range(n-k+1):

    res = max(res, s[i+k] - s[i])

print((res/2))

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations,accumulate # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

import re

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

  return list(map(int,input().split()))

def I():

  return int(eval(input()))

n,k = readInts()

p = [0] + list([int (x) + 1 for x in input().split()])

cum = list(accumulate(p))

res = 0

for i in range(len(p)-k):

    res = max(res, cum[i+k] - cum[i])

print((res / 2))

n, k = list(map(int, input().split()))
P = list([int(x) + 1 for x in input().split()])
s = [0] * (n + 1)
for i in range(n):
    s[i + 1] = s[i] + P[i]
res = 0
for i in range(n - k + 1):
    res = max(res, s[i + k] - s[i])
print((res / 2))

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal
import re

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


n, k = readInts()
p = [0] + list([int(x) + 1 for x in input().split()])
cum = list(accumulate(p))
res = 0
for i in range(len(p) - k):
    res = max(res, cum[i + k] - cum[i])
print((res / 2))

-n, k = list(map(int, input().split())) -P = list([int(x) + 1 for x in input().split()]) -s = [0] * (n + 1) -for i in range(n): -    s[i + 1] = s[i] + P[i] +# from statistics import median +# import collections +# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] +from fractions import gcd +from itertools import combinations, permutations, accumulate  # (string,3) 3回 + +# from collections import deque +from collections import deque, defaultdict, Counter +import decimal +import re + +# import bisect +# +#    d = m - k[i] - k[j] +#    if kk[bisect.bisect_right(kk,d) - 1] == d: +# +# +# +# pythonで無理なときは、pypyでやると正解するかも！！ +# +# +import sys + +sys.setrecursionlimit(10000000) +mod = 10**9 + 7 +# mod = 9982443453 +def readInts(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +n, k = readInts() +p = [0] + list([int(x) + 1 for x in input().split()]) +cum = list(accumulate(p)) -for i in range(n - k + 1): -    res = max(res, s[i + k] - s[i]) +for i in range(len(p) - k): +    res = max(res, cum[i + k] - cum[i])