
def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a)

if __name__ == "__main__":
    main() def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a) main n, k = map(int, input().split(" ")) n map(int, input().split(" ")) map int input().split(" ") ().split () input split " " k p = list(map(int, input().split(" "))) p list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " u = [0] u [0] 0 v = [] v [] w = [] w [] for i in range(n):
        u.append(u[i]+p[i])
     i range(n) range n u.append(u[i]+p[i]) u.append u append u[i]+p[i] u[i] u i p[i] p i for i in range(n-k+1):
        w.append(u[k+i]-u[i])
     i range(n-k+1) range n-k+1 n-k n k 1 w.append(u[k+i]-u[i]) w.append w append u[k+i]-u[i] u[k+i] u k+i k i u[i] u i x = w.index(max(w)) x w.index(max(w)) w.index w index max(w) max w for i in range(k):
        v.append(p[x+i])
     i range(k) range k v.append(p[x+i]) v.append v append p[x+i] p x+i x i a=0 a 0 for i in range(k):
        a += 1+0.5*(v[i]-1)
     i range(k) range k a += 1+0.5*(v[i]-1) a 1+0.5*(v[i]-1) 1 0.5*(v[i]-1) 0.5 v[i]-1 v[i] v i 1 print(a) print a if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a) def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a) main

def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a)

if __name__ == "__main__":
    main()