from statistics import median

from time import time



t = time()



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

line_in_dice = list([int(x) for x in input().split()])



result = [0] * (N + K)



result[0] = line_in_dice[0]

result[K] -= line_in_dice[0]



max_point = 0

max_value = 0



for i in range(1, N):

    result[i] += (result[i - 1] + line_in_dice[i])

    result[i + K] -= line_in_dice[i]



    if result[i] > max_value:

        max_point = i

        max_value = result[i]





def create_median(x):

    if x % 2 == 1:

        return (1 + x) // 2

    else:

        return ((x // 2) + (x // 2 + 1)) / 2





print((sum(create_median(x)

          for x in line_in_dice[max_point - K + 1: max_point+1])))

from statistics import median



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

line_in_dice = list([(int(x) + 1) / 2 for x in input().split()])



result = [0] * (N + K)



result[0] = line_in_dice[0]

result[K] -= line_in_dice[0]



max_point = 0

max_value = 0



for i in range(1, N):

    result[i] += (result[i - 1] + line_in_dice[i])

    result[i + K] -= line_in_dice[i]



print((max(result)))

from statistics import median
from time import time

t = time()
N, K = [int(x) for x in input().split()]
line_in_dice = list([int(x) for x in input().split()])
result = [0] * (N + K)
result[0] = line_in_dice[0]
result[K] -= line_in_dice[0]
max_point = 0
max_value = 0
for i in range(1, N):
    result[i] += result[i - 1] + line_in_dice[i]
    result[i + K] -= line_in_dice[i]
    if result[i] > max_value:
        max_point = i
        max_value = result[i]


def create_median(x):
    if x % 2 == 1:
        return (1 + x) // 2
    else:
        return ((x // 2) + (x // 2 + 1)) / 2


print((sum(create_median(x) for x in line_in_dice[max_point - K + 1 : max_point + 1])))

from statistics import median

N, K = [int(x) for x in input().split()]
line_in_dice = list([(int(x) + 1) / 2 for x in input().split()])
result = [0] * (N + K)
result[0] = line_in_dice[0]
result[K] -= line_in_dice[0]
max_point = 0
max_value = 0
for i in range(1, N):
    result[i] += result[i - 1] + line_in_dice[i]
    result[i + K] -= line_in_dice[i]
print((max(result)))

-from time import time -t = time() -line_in_dice = list([int(x) for x in input().split()]) +line_in_dice = list([(int(x) + 1) / 2 for x in input().split()]) -    if result[i] > max_value: -        max_point = i -        max_value = result[i] - - -def create_median(x): -    if x % 2 == 1: -        return (1 + x) // 2 -    else: -        return ((x // 2) + (x // 2 + 1)) / 2 - - -print((sum(create_median(x) for x in line_in_dice[max_point - K + 1 : max_point + 1]))) +print((max(result)))