import sys

N, K = map(int, sys.stdin.readline().rstrip().split())
P = [int(x) for x in sys.stdin.readline().rstrip().split()]


# 目が 1 ... p のときの期待値
def kitaichi(p):
    return (p + 1) / 2

goukei = 0
for i in range(K):
    goukei += kitaichi(P[i])

gmax = goukei
for i in range(N - K):
    goukei = goukei + kitaichi(P[K + i]) - kitaichi(P[i])  # 次の区間の合計
    gmax = max(goukei, gmax)

print(gmax) import sys sys N, K = map(int, sys.stdin.readline().rstrip().split()) N map(int, sys.stdin.readline().rstrip().split()) map int sys.stdin.readline().rstrip().split() sys.stdin.readline().rstrip().split sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip split K int(x) for x in sys.stdin.readline().rstrip().split() for x in sys.stdin.readline().rstrip().split() x sys.stdin.readline().rstrip().split() sys.stdin.readline().rstrip().split sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip split for x in sys.stdin.readline().rstrip().split() int(x) int x P = [int(x) for x in sys.stdin.readline().rstrip().split()] P [int(x) for x in sys.stdin.readline().rstrip().split()] def kitaichi(p):
    return (p + 1) / 2 kitaichi return (p + 1) / 2 (p + 1) / 2 p + 1 p 1 2 p p goukei = 0 goukei 0 for i in range(K):
    goukei += kitaichi(P[i]) i range(K) range K goukei += kitaichi(P[i]) goukei kitaichi(P[i]) kitaichi P[i] P i gmax = goukei gmax goukei for i in range(N - K):
    goukei = goukei + kitaichi(P[K + i]) - kitaichi(P[i])  # 次の区間の合計
    gmax = max(goukei, gmax) i range(N - K) range N - K N K goukei = goukei + kitaichi(P[K + i]) - kitaichi(P[i]) goukei goukei + kitaichi(P[K + i]) - kitaichi(P[i]) goukei + kitaichi(P[K + i]) goukei kitaichi(P[K + i]) kitaichi P[K + i] P K + i K i kitaichi(P[i]) kitaichi P[i] P i gmax = max(goukei, gmax) gmax max(goukei, gmax) max goukei gmax print(gmax) print gmax K = map(int, sys.stdin.readline().rstrip().split()) map(int, sys.stdin.readline().rstrip().split()) K gmax = max(goukei, gmax) max(goukei, gmax) gmax P = [int(x) for x in sys.stdin.readline().rstrip().split()] [int(x) for x in sys.stdin.readline().rstrip().split()] P goukei = 0 0 goukei goukei += kitaichi(P[i]) kitaichi(P[i]) goukei goukei = goukei + kitaichi(P[K + i]) - kitaichi(P[i]) goukei + kitaichi(P[K + i]) - kitaichi(P[i]) goukei N, K = map(int, sys.stdin.readline().rstrip().split()) map(int, sys.stdin.readline().rstrip().split()) N def kitaichi(p):
    return (p + 1) / 2 def kitaichi(p):
    return (p + 1) / 2 kitaichi gmax = goukei goukei gmax
import sys

N, K = map(int, sys.stdin.readline().rstrip().split())
P = [int(x) for x in sys.stdin.readline().rstrip().split()]


# 目が 1 ... p のときの期待値
def kitaichi(p):
    return (p + 1) / 2

goukei = 0
for i in range(K):
    goukei += kitaichi(P[i])

gmax = goukei
for i in range(N - K):
    goukei = goukei + kitaichi(P[K + i]) - kitaichi(P[i])  # 次の区間の合計
    gmax = max(goukei, gmax)

print(gmax)
