def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv)
if __name__ == '__main__':
    main() def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () 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()] p_e = list() p_e list() list exp = 0 exp 0 for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
     p P exp += (1+p)/2 exp (1+p)/2 1+p 1 p 2 p_e.append(exp) p_e.append p_e append exp maxv = p_e[k-1] - 0 maxv p_e[k-1] - 0 p_e[k-1] p_e k-1 k 1 0 for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
     i range(1, n-k) range 1 n-k n k p_sum = p_e[k+i] - p_e[i] p_sum p_e[k+i] - p_e[i] p_e[k+i] p_e k+i k i p_e[i] p_e i maxv = max(maxv, p_sum) maxv max(maxv, p_sum) max maxv p_sum print(maxv) print maxv if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv) def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv) main
def main():
    n, k = map(int, input().split())
    P = [int(x) for x in input().split()]
    p_e = list()
    exp = 0
    for p in P:
        # 期待値
        # 累積和
        exp += (1+p)/2
        p_e.append(exp)
    # 初期値
    maxv = p_e[k-1] - 0
    for i in range(1, n-k):
        # 隣接するk個の期待値の和
        p_sum = p_e[k+i] - p_e[i]
        maxv = max(maxv, p_sum)
    print(maxv)
if __name__ == '__main__':
    main()
