import sys

read = sys.stdin.readline





def read_ints():

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





def read_a_int():

    return int(read())





def read_matrix(H):

    '''

    H is number of rows

    '''

    return [list(map(int, read().split())) for _ in range(H)]





def read_map(H):

    '''

    H is number of rows

    文字列で与えられた盤面を読み取る用

    '''

    return [read()[:-1] for _ in range(H)]





def read_tuple(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(tuple(map(int, read().split())))

    return ret





def read_col(H, n_cols):

    '''

    H is number of rows

    n_cols is number of cols



    A列、B列が与えられるようなとき

    '''

    ret = [[] for _ in range(n_cols)]

    for _ in range(H):

        tmp = list(map(int, read().split()))

        for col in range(n_cols):

            ret[col].append(tmp[col])



    return ret





N, K = read_ints()

P = read_ints()





def ret_mean(X):

    return (X + 1) / 2









import numpy as np

P_mean = np.array([ret_mean(p) for p in P])

P_accum = np.zeros(N+1)

P_accum[1:] = P_mean.cumsum()



ans = 0

# print(P_accum)

for i in range(N - K + 1):

    j = i + K

    ans = max(ans, P_accum[j] - P_accum[i])

print(ans)

import sys

read = sys.stdin.readline





def read_ints():

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





def read_a_int():

    return int(read())





def read_matrix(H):

    '''

    H is number of rows

    '''

    return [list(map(int, read().split())) for _ in range(H)]





def read_map(H):

    '''

    H is number of rows

    文字列で与えられた盤面を読み取る用

    '''

    return [read()[:-1] for _ in range(H)]





def read_tuple(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(tuple(map(int, read().split())))

    return ret





def read_col(H, n_cols):

    '''

    H is number of rows

    n_cols is number of cols



    A列、B列が与えられるようなとき

    '''

    ret = [[] for _ in range(n_cols)]

    for _ in range(H):

        tmp = list(map(int, read().split()))

        for col in range(n_cols):

            ret[col].append(tmp[col])



    return ret





N, K = read_ints()

P = read_ints()





def ret_mean(X):

    return (X + 1) / 2







class cumsum1d:

    def __init__(self, ls: list):

        '''

        1次元リストを受け取る

        '''

        from itertools import accumulate

        self.ls_accum = [0] + list(accumulate(ls))



    def total(self, i, j):

        # もとの配列lsにおける[i,j)の中合計

        return self.ls_accum[j] - self.ls_accum[i]

      

P_mean = [ret_mean(p) for p in P]

P_accum = cumsum1d(P_mean)



ans = 0

# print(P_accum)

for i in range(N - K + 1):

    j = i + K

    ans = max(ans, P_accum.total(i,j))

print(ans)

import sys

read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    """
    H is number of rows
    """
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    """
    H is number of rows
    文字列で与えられた盤面を読み取る用
    """
    return [read()[:-1] for _ in range(H)]


def read_tuple(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    """
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    """
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


N, K = read_ints()
P = read_ints()


def ret_mean(X):
    return (X + 1) / 2


import numpy as np

P_mean = np.array([ret_mean(p) for p in P])
P_accum = np.zeros(N + 1)
P_accum[1:] = P_mean.cumsum()
ans = 0
# print(P_accum)
for i in range(N - K + 1):
    j = i + K
    ans = max(ans, P_accum[j] - P_accum[i])
print(ans)

import sys

read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    """
    H is number of rows
    """
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    """
    H is number of rows
    文字列で与えられた盤面を読み取る用
    """
    return [read()[:-1] for _ in range(H)]


def read_tuple(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    """
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    """
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


N, K = read_ints()
P = read_ints()


def ret_mean(X):
    return (X + 1) / 2


class cumsum1d:
    def __init__(self, ls: list):
        """
        1次元リストを受け取る
        """
        from itertools import accumulate

        self.ls_accum = [0] + list(accumulate(ls))

    def total(self, i, j):
        # もとの配列lsにおける[i,j)の中合計
        return self.ls_accum[j] - self.ls_accum[i]


P_mean = [ret_mean(p) for p in P]
P_accum = cumsum1d(P_mean)
ans = 0
# print(P_accum)
for i in range(N - K + 1):
    j = i + K
    ans = max(ans, P_accum.total(i, j))
print(ans)

-import numpy as np +class cumsum1d: +    def __init__(self, ls: list): +        """ +        1次元リストを受け取る +        """ +        from itertools import accumulate -P_mean = np.array([ret_mean(p) for p in P]) -P_accum = np.zeros(N + 1) -P_accum[1:] = P_mean.cumsum() +        self.ls_accum = [0] + list(accumulate(ls)) + +    def total(self, i, j): +        # もとの配列lsにおける[i,j)の中合計 +        return self.ls_accum[j] - self.ls_accum[i] + + +P_mean = [ret_mean(p) for p in P] +P_accum = cumsum1d(P_mean) -    ans = max(ans, P_accum[j] - P_accum[i]) +    ans = max(ans, P_accum.total(i, j))