n,k=map(int,input().split())
p=list(map(int,input().split()))

def kitai(n):
  result = 0
  for i in range(1,n+1):
    result += i
  return result/n

s=[0]*(n+1)
for i in range(n):
  s[i+1] = s[i] + p[i]

resi = 0
tmp = 0
for i in range(n-k+1):
  if s[i+k]-s[i] > tmp:
    resi = i
    tmp = s[i+k]-s[i]

result = 0
for i in range(resi,k+resi):
  result += kitai(p[i])
print(result) 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 def kitai(n):
  result = 0
  for i in range(1,n+1):
    result += i
  return result/n kitai result = 0 result 0 for i in range(1,n+1):
    result += i
   i range(1,n+1) range 1 n+1 n 1 result += i result i return result/n result/n result n n n s=[0]*(n+1) s [0]*(n+1) [0] 0 n+1 n 1 for i in range(n):
  s[i+1] = s[i] + p[i] i range(n) range n s[i+1] = s[i] + p[i] s[i+1] s i+1 i 1 s[i] + p[i] s[i] s i p[i] p i resi = 0 resi 0 tmp = 0 tmp 0 for i in range(n-k+1):
  if s[i+k]-s[i] > tmp:
    resi = i
    tmp = s[i+k]-s[i] i range(n-k+1) range n-k+1 n-k n k 1 if s[i+k]-s[i] > tmp:
    resi = i
    tmp = s[i+k]-s[i] s[i+k]-s[i] > tmp s[i+k]-s[i] s[i+k] s i+k i k s[i] s i tmp resi = i resi i tmp = s[i+k]-s[i] tmp s[i+k]-s[i] s[i+k] s i+k i k s[i] s i result = 0 result 0 for i in range(resi,k+resi):
  result += kitai(p[i]) i range(resi,k+resi) range resi k+resi k resi result += kitai(p[i]) result kitai(p[i]) kitai p[i] p i print(result) print result result += kitai(p[i]) kitai(p[i]) result n,k=map(int,input().split()) map(int,input().split()) n p=list(map(int,input().split())) list(map(int,input().split())) p s=[0]*(n+1) [0]*(n+1) s resi = 0 0 resi resi = i i resi tmp = s[i+k]-s[i] s[i+k]-s[i] tmp k=map(int,input().split()) map(int,input().split()) k tmp = 0 0 tmp def kitai(n):
  result = 0
  for i in range(1,n+1):
    result += i
  return result/n def kitai(n):
  result = 0
  for i in range(1,n+1):
    result += i
  return result/n kitai result = 0 0 result
n,k=map(int,input().split())
p=list(map(int,input().split()))

def kitai(n):
  result = 0
  for i in range(1,n+1):
    result += i
  return result/n

s=[0]*(n+1)
for i in range(n):
  s[i+1] = s[i] + p[i]

resi = 0
tmp = 0
for i in range(n-k+1):
  if s[i+k]-s[i] > tmp:
    resi = i
    tmp = s[i+k]-s[i]

result = 0
for i in range(resi,k+resi):
  result += kitai(p[i])
print(result)