import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
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())
def main():
    n,k = LI()
    p = LI()
    for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

    nowsum = sum(p[:k])
    ans = nowsum
    for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
    print(ans)
main()             import bisect,collections,copy,itertools,math,string bisect collections copy itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I 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 def main():
    n,k = LI()
    p = LI()
    for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

    nowsum = sum(p[:k])
    ans = nowsum
    for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
    print(ans) main n,k = LI() n LI() LI k p = LI() p LI() LI for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

     i x enumerate(p) enumerate p if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
         x%2 == 0 x%2 x 2 0 x = x//2+0.5 x x//2+0.5 x//2 x 2 0.5 x = x//2+1 x x//2+1 x//2 x 2 1 p[i] = x p[i] p i x nowsum = sum(p[:k]) nowsum sum(p[:k]) sum p[:k] p :k k ans = nowsum ans nowsum for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
     i range(k,n) range k n nowsum = nowsum - p[i-k] + p[i] nowsum nowsum - p[i-k] + p[i] nowsum - p[i-k] nowsum p[i-k] p i-k i k p[i] p i ans = max(ans,nowsum) ans max(ans,nowsum) max ans nowsum print(ans) print ans main() main def main():
    n,k = LI()
    p = LI()
    for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

    nowsum = sum(p[:k])
    ans = nowsum
    for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
    print(ans) def main():
    n,k = LI()
    p = LI()
    for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

    nowsum = sum(p[:k])
    ans = nowsum
    for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
    print(ans) main def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
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())
def main():
    n,k = LI()
    p = LI()
    for i,x in enumerate(p):
        if x%2 == 0:
            x = x//2+0.5
        else:
            x = x//2+1
        p[i] = x

    nowsum = sum(p[:k])
    ans = nowsum
    for i in range(k,n):
        nowsum = nowsum - p[i-k] + p[i]
        # print(p,lst)
        ans = max(ans,nowsum)
    
    print(ans)
main()            
