from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  PP = [0]*N
  for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

  S = [0]*(N+1)
  for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

  max_ = 0
  for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

  print(max_)


if(__name__ == '__main__'):
  main() from collections import defaultdict from collections import deque from collections import OrderedDict import itertools itertools from sys import stdin input = stdin.readline input stdin.readline stdin readline def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  PP = [0]*N
  for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

  S = [0]*(N+1)
  for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

  max_ = 0
  for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

  print(max_) main N, K = list(map(int, input().split())) N list(map(int, input().split())) list 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 PP = [0]*N PP [0]*N [0] 0 N for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

   i p enumerate(P) enumerate P PP[i] = p*(p+1)/(2*p) PP[i] PP i p*(p+1)/(2*p) p*(p+1) p p+1 p 1 2*p 2 p S = [0]*(N+1) S [0]*(N+1) [0] 0 N+1 N 1 for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

   i range(1, N+1) range 1 N+1 N 1 S[i] = PP[i-1] + S[i-1] S[i] S i PP[i-1] + S[i-1] PP[i-1] PP i-1 i 1 S[i-1] S i-1 i 1 max_ = 0 max_ 0 for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

   i range(0, N-K+1) range 0 N-K+1 N-K N K 1 max_ = max(max_, S[i+K] - S[i]) max_ max(max_, S[i+K] - S[i]) max max_ S[i+K] - S[i] S[i+K] S i+K i K S[i] S i print(max_) print max_ if(__name__ == '__main__'):
  main() __name__ == '__main__' __name__ '__main__' main() main def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  PP = [0]*N
  for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

  S = [0]*(N+1)
  for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

  max_ = 0
  for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

  print(max_) def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  PP = [0]*N
  for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

  S = [0]*(N+1)
  for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

  max_ = 0
  for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

  print(max_) main input = stdin.readline stdin.readline input
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  PP = [0]*N
  for i, p in enumerate(P):
    PP[i] = p*(p+1)/(2*p)

  S = [0]*(N+1)
  for i in range(1, N+1):
    S[i] = PP[i-1] + S[i-1]

  max_ = 0
  for i in range(0, N-K+1):
    max_ = max(max_, S[i+K] - S[i])

  print(max_)


if(__name__ == '__main__'):
  main()
