def expect(n):
        return (n+1)/2

nk = input().split()
N = int(nk[0])
K = int(nk[1])
p = input().split()

tmp = 0
for i in range (K):
    tmp += expect(int(p[i]))

tmpMax = tmp

for i in range(N - K):
    tmp -= expect(int(p[i]))
    tmp += expect(int(p[i+K]))
    tmpMax = max(tmpMax, tmp)

print(tmpMax)
 def expect(n):
        return (n+1)/2 expect return (n+1)/2 (n+1)/2 n+1 n 1 2 n n nk = input().split() nk input().split() ().split () input split N = int(nk[0]) N int(nk[0]) int nk[0] nk 0 K = int(nk[1]) K int(nk[1]) int nk[1] nk 1 p = input().split() p input().split() ().split () input split tmp = 0 tmp 0 for i in range (K):
    tmp += expect(int(p[i])) i range (K) range K tmp += expect(int(p[i])) tmp expect(int(p[i])) expect int(p[i]) int p[i] p i tmpMax = tmp tmpMax tmp for i in range(N - K):
    tmp -= expect(int(p[i]))
    tmp += expect(int(p[i+K]))
    tmpMax = max(tmpMax, tmp) i range(N - K) range N - K N K tmp -= expect(int(p[i])) tmp expect(int(p[i])) expect int(p[i]) int p[i] p i tmp += expect(int(p[i+K])) tmp expect(int(p[i+K])) expect int(p[i+K]) int p[i+K] p i+K i K tmpMax = max(tmpMax, tmp) tmpMax max(tmpMax, tmp) max tmpMax tmp print(tmpMax) print tmpMax tmp += expect(int(p[i])) expect(int(p[i])) tmp def expect(n):
        return (n+1)/2 def expect(n):
        return (n+1)/2 expect tmpMax = tmp tmp tmpMax nk = input().split() input().split() nk tmp = 0 0 tmp K = int(nk[1]) int(nk[1]) K N = int(nk[0]) int(nk[0]) N p = input().split() input().split() p tmp -= expect(int(p[i])) expect(int(p[i])) tmp tmpMax = max(tmpMax, tmp) max(tmpMax, tmp) tmpMax tmp += expect(int(p[i+K])) expect(int(p[i+K])) tmp
def expect(n):
        return (n+1)/2

nk = input().split()
N = int(nk[0])
K = int(nk[1])
p = input().split()

tmp = 0
for i in range (K):
    tmp += expect(int(p[i]))

tmpMax = tmp

for i in range(N - K):
    tmp -= expect(int(p[i]))
    tmp += expect(int(p[i+K]))
    tmpMax = max(tmpMax, tmp)

print(tmpMax)

