import os, sys, re, math


def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp


(N, K) = [int(n) for n in input().split()]
P = [int(n) for n in input().split()]

exps = [get_exp_value(i) for i in range(200001)]

s = sum(P[0:K])
max_sum = 0
max_pos = 0
for i in range(K, N):
    s = s - P[i - K] + P[i]
    if s > max_sum:
        max_sum = s
        max_pos = i

answer = 0
for i in range(max_pos - K, max_pos):
    answer += exps[P[i + 1]]

print(answer) import os, sys, re, math os sys re math def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp get_exp_value if number == 0:
        return 0
     number == 0 number 0 return 0 0 a = (number + 1) / number a (number + 1) / number number + 1 number 1 number exp = a * (number // 2) exp a * (number // 2) a number // 2 number 2 if number % 2 != 0:
        exp += a / 2

     number % 2 != 0 number % 2 number 2 0 exp += a / 2 exp a / 2 a 2 return exp exp number number int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n (N, K) = [int(n) for n in input().split()] (N, K) N K [int(n) for n in input().split()] int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n P = [int(n) for n in input().split()] P [int(n) for n in input().split()] get_exp_value(i) for i in range(200001) for i in range(200001) i range(200001) range 200001 for i in range(200001) get_exp_value(i) get_exp_value i exps = [get_exp_value(i) for i in range(200001)] exps [get_exp_value(i) for i in range(200001)] s = sum(P[0:K]) s sum(P[0:K]) sum P[0:K] P 0:K 0 K max_sum = 0 max_sum 0 max_pos = 0 max_pos 0 for i in range(K, N):
    s = s - P[i - K] + P[i]
    if s > max_sum:
        max_sum = s
        max_pos = i i range(K, N) range K N s = s - P[i - K] + P[i] s s - P[i - K] + P[i] s - P[i - K] s P[i - K] P i - K i K P[i] P i if s > max_sum:
        max_sum = s
        max_pos = i s > max_sum s max_sum max_sum = s max_sum s max_pos = i max_pos i answer = 0 answer 0 for i in range(max_pos - K, max_pos):
    answer += exps[P[i + 1]] i range(max_pos - K, max_pos) range max_pos - K max_pos K max_pos answer += exps[P[i + 1]] answer exps[P[i + 1]] exps P[i + 1] P i + 1 i 1 print(answer) print answer def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp get_exp_value max_pos = i i max_pos s = s - P[i - K] + P[i] s - P[i - K] + P[i] s answer = 0 0 answer P = [int(n) for n in input().split()] [int(n) for n in input().split()] P max_pos = 0 0 max_pos max_sum = s s max_sum exps = [get_exp_value(i) for i in range(200001)] [get_exp_value(i) for i in range(200001)] exps s = sum(P[0:K]) sum(P[0:K]) s answer += exps[P[i + 1]] exps[P[i + 1]] answer max_sum = 0 0 max_sum
import os, sys, re, math


def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp


(N, K) = [int(n) for n in input().split()]
P = [int(n) for n in input().split()]

exps = [get_exp_value(i) for i in range(200001)]

s = sum(P[0:K])
max_sum = 0
max_pos = 0
for i in range(K, N):
    s = s - P[i - K] + P[i]
    if s > max_sum:
        max_sum = s
        max_pos = i

answer = 0
for i in range(max_pos - K, max_pos):
    answer += exps[P[i + 1]]

print(answer)
