#!/usr/bin/env python3

def calcExpectedValue(prob):
  return (prob+1)/2

def solve(n,k,p):
  expLst = [calcExpectedValue(prob) for prob in p]
  cum = [0]*(n+1)
  for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
  ans = 0
  i = 0
  while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
  return ans




def main():
  N,K = map(int,input().split())
  p = list(map(int,input().split()))
  print(solve(N,K,p))
  return

if __name__ == '__main__':
  main() def calcExpectedValue(prob):
  return (prob+1)/2 calcExpectedValue return (prob+1)/2 (prob+1)/2 prob+1 prob 1 2 prob prob def solve(n,k,p):
  expLst = [calcExpectedValue(prob) for prob in p]
  cum = [0]*(n+1)
  for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
  ans = 0
  i = 0
  while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
  return ans solve calcExpectedValue(prob) for prob in p for prob in p prob p for prob in p calcExpectedValue(prob) calcExpectedValue prob expLst = [calcExpectedValue(prob) for prob in p] expLst [calcExpectedValue(prob) for prob in p] cum = [0]*(n+1) cum [0]*(n+1) [0] 0 n+1 n 1 for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
   i range(n) range n cum[i+1] = cum[i] + expLst[i] cum[i+1] cum i+1 i 1 cum[i] + expLst[i] cum[i] cum i expLst[i] expLst i ans = 0 ans 0 i = 0 i 0 while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
   i+k <= n i+k i k n ans = max(ans,cum[i+k]-cum[i]) ans max(ans,cum[i+k]-cum[i]) max ans cum[i+k]-cum[i] cum[i+k] cum i+k i k cum[i] cum i i += 1 i 1 return ans ans n n k k p p def main():
  N,K = map(int,input().split())
  p = list(map(int,input().split()))
  print(solve(N,K,p))
  return 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 print(solve(N,K,p)) print solve(N,K,p) solve N K p return if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def solve(n,k,p):
  expLst = [calcExpectedValue(prob) for prob in p]
  cum = [0]*(n+1)
  for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
  ans = 0
  i = 0
  while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
  return ans def solve(n,k,p):
  expLst = [calcExpectedValue(prob) for prob in p]
  cum = [0]*(n+1)
  for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
  ans = 0
  i = 0
  while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
  return ans solve def main():
  N,K = map(int,input().split())
  p = list(map(int,input().split()))
  print(solve(N,K,p))
  return def main():
  N,K = map(int,input().split())
  p = list(map(int,input().split()))
  print(solve(N,K,p))
  return main def calcExpectedValue(prob):
  return (prob+1)/2 def calcExpectedValue(prob):
  return (prob+1)/2 calcExpectedValue
#!/usr/bin/env python3

def calcExpectedValue(prob):
  return (prob+1)/2

def solve(n,k,p):
  expLst = [calcExpectedValue(prob) for prob in p]
  cum = [0]*(n+1)
  for i in range(n):
    cum[i+1] = cum[i] + expLst[i]
  ans = 0
  i = 0
  while i+k <= n:
    ans = max(ans,cum[i+k]-cum[i])
    i += 1
  return ans




def main():
  N,K = map(int,input().split())
  p = list(map(int,input().split()))
  print(solve(N,K,p))
  return

if __name__ == '__main__':
  main()
