import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, K = lr()

P = np.array([0] + lr())

P = (P+1) / 2

Pcum = P.cumsum()

X = Pcum[K:] - Pcum[:-K]

answer = X.max()

print(answer)

# coding: utf-8

import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N, K = lr()

P = np.array([0] + lr(), np.float64)

P = (P+1) / 2

Pcum = P.cumsum()

expectation = Pcum[K:] - Pcum[:-K]

answer = expectation.max()

print(answer)

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
P = np.array([0] + lr())
P = (P + 1) / 2
Pcum = P.cumsum()
X = Pcum[K:] - Pcum[:-K]
answer = X.max()
print(answer)

# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
P = np.array([0] + lr(), np.float64)
P = (P + 1) / 2
Pcum = P.cumsum()
expectation = Pcum[K:] - Pcum[:-K]
answer = expectation.max()
print(answer)

+# coding: utf-8 -P = np.array([0] + lr()) +P = np.array([0] + lr(), np.float64) -X = Pcum[K:] - Pcum[:-K] -answer = X.max() +expectation = Pcum[K:] - Pcum[:-K] +answer = expectation.max()