import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
def main():
    N, K = MI()
    P = LI()
    a = sum(P[0:K])
    Sums = []
    Sum = 0
    for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
    ans = [a, 0, K - 1]
    for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
    cnt = 0
    for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
    print(cnt)
if __name__ == "__main__":
    main() import bisect, collections, copy, heapq, itertools, math, string bisect collections copy heapq itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip().split()) LS from  collections import defaultdict from collections import Counter import bisect bisect def main():
    N, K = MI()
    P = LI()
    a = sum(P[0:K])
    Sums = []
    Sum = 0
    for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
    ans = [a, 0, K - 1]
    for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
    cnt = 0
    for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
    print(cnt) main N, K = MI() N MI() MI K P = LI() P LI() LI a = sum(P[0:K]) a sum(P[0:K]) sum P[0:K] P 0:K 0 K Sums = [] Sums [] Sum = 0 Sum 0 for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
     i range(N) range N Sum += P[i] Sum P[i] P i Sums.append(Sum) Sums.append Sums append Sum ans = [a, 0, K - 1] ans [a, 0, K - 1] a 0 K - 1 K 1 for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
     i range(K, N) range K N X = Sums[i] - Sums[i - K] X Sums[i] - Sums[i - K] Sums[i] Sums i Sums[i - K] Sums i - K i K if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
     X > ans[0] X ans[0] ans 0 ans[0] = X ans[0] ans 0 X ans[1] = i - K + 1 ans[1] ans 1 i - K + 1 i - K i K 1 ans[2] = i ans[2] ans 2 i cnt = 0 cnt 0 for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
     i range(ans[1], ans[2] + 1) range ans[1] ans 1 ans[2] + 1 ans[2] ans 2 1 cnt += (P[i] + 1) / 2 cnt (P[i] + 1) / 2 P[i] + 1 P[i] P i 1 2 print(cnt) print cnt if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) LI def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I def main():
    N, K = MI()
    P = LI()
    a = sum(P[0:K])
    Sums = []
    Sum = 0
    for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
    ans = [a, 0, K - 1]
    for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
    cnt = 0
    for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
    print(cnt) def main():
    N, K = MI()
    P = LI()
    a = sum(P[0:K])
    Sums = []
    Sum = 0
    for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
    ans = [a, 0, K - 1]
    for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
    cnt = 0
    for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
    print(cnt) main def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def MI(): return map(int, sys.stdin.readline().rstrip().split()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) MI
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
def main():
    N, K = MI()
    P = LI()
    a = sum(P[0:K])
    Sums = []
    Sum = 0
    for i in range(N):
        Sum += P[i]
        Sums.append(Sum)
    ans = [a, 0, K - 1]
    for i in range(K, N):
        X = Sums[i] - Sums[i - K]
        if X > ans[0]:
            ans[0] = X
            ans[1] = i - K + 1
            ans[2] = i
    cnt = 0
    for i in range(ans[1], ans[2] + 1):
        cnt += (P[i] + 1) / 2
    print(cnt)
if __name__ == "__main__":
    main()