import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    n,k = I2()
    p = Intl()
    s = 0
    for i in range(k):
        s += (p[i] + 1)/2
    ans = s
    for i in range(k,n):
        s += (p[i] + 1)/2
        s -= (p[i-k] + 1)/2
        ans = max(ans,s)
    print(ans) import sys sys import math math def I():return int(sys.stdin.readline().replace("\n","")) I def I2():return map(int,sys.stdin.readline().replace("\n","").split()) I2 def S():return str(sys.stdin.readline().replace("\n","")) S def L():return list(sys.stdin.readline().replace("\n","")) L int(k) for k in sys.stdin.readline().replace("\n","").split() for k in sys.stdin.readline().replace("\n","").split() k sys.stdin.readline().replace("\n","").split() sys.stdin.readline().replace("\n","").split sys.stdin.readline().replace("\n","") sys.stdin.readline().replace sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline replace "\n" "" split for k in sys.stdin.readline().replace("\n","").split() int(k) int k def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()] Intl def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split())) Lx k k if __name__ == "__main__":
    n,k = I2()
    p = Intl()
    s = 0
    for i in range(k):
        s += (p[i] + 1)/2
    ans = s
    for i in range(k,n):
        s += (p[i] + 1)/2
        s -= (p[i-k] + 1)/2
        ans = max(ans,s)
    print(ans) __name__ == "__main__" __name__ "__main__" n,k = I2() n I2() I2 k p = Intl() p Intl() Intl s = 0 s 0 for i in range(k):
        s += (p[i] + 1)/2
     i range(k) range k s += (p[i] + 1)/2 s (p[i] + 1)/2 p[i] + 1 p[i] p i 1 2 ans = s ans s for i in range(k,n):
        s += (p[i] + 1)/2
        s -= (p[i-k] + 1)/2
        ans = max(ans,s)
     i range(k,n) range k n s += (p[i] + 1)/2 s (p[i] + 1)/2 p[i] + 1 p[i] p i 1 2 s -= (p[i-k] + 1)/2 s (p[i-k] + 1)/2 p[i-k] + 1 p[i-k] p i-k i k 1 2 ans = max(ans,s) ans max(ans,s) max ans s print(ans) print ans def L():return list(sys.stdin.readline().replace("\n","")) def L():return list(sys.stdin.readline().replace("\n","")) L s += (p[i] + 1)/2 (p[i] + 1)/2 s def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split())) def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split())) Lx ans = s s ans k = I2() I2() k def I2():return map(int,sys.stdin.readline().replace("\n","").split()) def I2():return map(int,sys.stdin.readline().replace("\n","").split()) I2 def S():return str(sys.stdin.readline().replace("\n","")) def S():return str(sys.stdin.readline().replace("\n","")) S def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()] def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()] Intl p = Intl() Intl() p n,k = I2() I2() n ans = max(ans,s) max(ans,s) ans s = 0 0 s s -= (p[i-k] + 1)/2 (p[i-k] + 1)/2 s def I():return int(sys.stdin.readline().replace("\n","")) def I():return int(sys.stdin.readline().replace("\n","")) I s += (p[i] + 1)/2 (p[i] + 1)/2 s
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    n,k = I2()
    p = Intl()
    s = 0
    for i in range(k):
        s += (p[i] + 1)/2
    ans = s
    for i in range(k,n):
        s += (p[i] + 1)/2
        s -= (p[i-k] + 1)/2
        ans = max(ans,s)
    print(ans)