# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,K=map(int, input().split())
P = list(map(int, input().split()))

S = []

for i in range(N):
    S.append((P[i]+1)/2)

tmp = sum(S[:K])
ans = tmp

for i in range(N-K):
    tmp = tmp - S[i] + S[i+K]
    ans = max(ans, tmp)


print(ans) import sys sys from fractions import gcd import math math from math import ceil,floor import collections collections from collections import Counter import itertools itertools import copy copy 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 S = [] S [] for i in range(N):
    S.append((P[i]+1)/2) i range(N) range N S.append((P[i]+1)/2) S.append S append (P[i]+1)/2 P[i]+1 P[i] P i 1 2 tmp = sum(S[:K]) tmp sum(S[:K]) sum S[:K] S :K K ans = tmp ans tmp for i in range(N-K):
    tmp = tmp - S[i] + S[i+K]
    ans = max(ans, tmp) i range(N-K) range N-K N K tmp = tmp - S[i] + S[i+K] tmp tmp - S[i] + S[i+K] tmp - S[i] tmp S[i] S i S[i+K] S i+K i K ans = max(ans, tmp) ans max(ans, tmp) max ans tmp print(ans) print ans tmp = sum(S[:K]) sum(S[:K]) tmp ans = tmp tmp ans N,K=map(int, input().split()) map(int, input().split()) N K=map(int, input().split()) map(int, input().split()) K ans = max(ans, tmp) max(ans, tmp) ans S = [] [] S P = list(map(int, input().split())) list(map(int, input().split())) P tmp = tmp - S[i] + S[i+K] tmp - S[i] + S[i+K] tmp
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,K=map(int, input().split())
P = list(map(int, input().split()))

S = []

for i in range(N):
    S.append((P[i]+1)/2)

tmp = sum(S[:K])
ans = tmp

for i in range(N-K):
    tmp = tmp - S[i] + S[i+K]
    ans = max(ans, tmp)


print(ans)
