N,K  = map(int,input().split())
p = list(map(int,input().split()))

dice = []
for i in range(N):
  temp = (1+p[i])/2
  dice.append(temp)

#print(dice)
ans = 0
prev = sum(dice[:K])
ans = prev
for i in range(K,N):
  temp = prev-dice[i-K]+dice[i]
  ans = max(ans,temp)
  prev = temp
print(ans) 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 dice = [] dice [] for i in range(N):
  temp = (1+p[i])/2
  dice.append(temp)

#print(dice) i range(N) range N temp = (1+p[i])/2 temp (1+p[i])/2 1+p[i] 1 p[i] p i 2 dice.append(temp) dice.append dice append temp ans = 0 ans 0 prev = sum(dice[:K]) prev sum(dice[:K]) sum dice[:K] dice :K K ans = prev ans prev for i in range(K,N):
  temp = prev-dice[i-K]+dice[i]
  ans = max(ans,temp)
  prev = temp i range(K,N) range K N temp = prev-dice[i-K]+dice[i] temp prev-dice[i-K]+dice[i] prev-dice[i-K] prev dice[i-K] dice i-K i K dice[i] dice i ans = max(ans,temp) ans max(ans,temp) max ans temp prev = temp prev temp print(ans) print ans N,K  = map(int,input().split()) map(int,input().split()) N ans = 0 0 ans ans = max(ans,temp) max(ans,temp) ans ans = prev prev ans dice = [] [] dice prev = sum(dice[:K]) sum(dice[:K]) prev temp = (1+p[i])/2 (1+p[i])/2 temp temp = prev-dice[i-K]+dice[i] prev-dice[i-K]+dice[i] temp K  = map(int,input().split()) map(int,input().split()) K prev = temp temp prev p = list(map(int,input().split())) list(map(int,input().split())) p
N,K  = map(int,input().split())
p = list(map(int,input().split()))

dice = []
for i in range(N):
  temp = (1+p[i])/2
  dice.append(temp)

#print(dice)
ans = 0
prev = sum(dice[:K])
ans = prev
for i in range(K,N):
  temp = prev-dice[i-K]+dice[i]
  ans = max(ans,temp)
  prev = temp
print(ans)
