N, K = map(int, input().split())
p = list(map(int, input().split()))
prospect = []
for k in range(N):
  if p[k]%2 == 1:
    prospect.append((p[k]+1)>>1)
  else:
    prospect.append((p[k]+1)/2)
S = sum(prospect[:K])
ans = 0 + S
for k in range(N-K):
  S += prospect[k+K] - prospect[k]
  ans = max(ans, S)
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 prospect = [] prospect [] for k in range(N):
  if p[k]%2 == 1:
    prospect.append((p[k]+1)>>1)
  else:
    prospect.append((p[k]+1)/2) k range(N) range N if p[k]%2 == 1:
    prospect.append((p[k]+1)>>1)
  else:
    prospect.append((p[k]+1)/2) p[k]%2 == 1 p[k]%2 p[k] p k 2 1 prospect.append((p[k]+1)>>1) prospect.append prospect append (p[k]+1)>>1 p[k]+1 p[k] p k 1 1 prospect.append((p[k]+1)/2) prospect.append prospect append (p[k]+1)/2 p[k]+1 p[k] p k 1 2 S = sum(prospect[:K]) S sum(prospect[:K]) sum prospect[:K] prospect :K K ans = 0 + S ans 0 + S 0 S for k in range(N-K):
  S += prospect[k+K] - prospect[k]
  ans = max(ans, S) k range(N-K) range N-K N K S += prospect[k+K] - prospect[k] S prospect[k+K] - prospect[k] prospect[k+K] prospect k+K k K prospect[k] prospect k ans = max(ans, S) ans max(ans, S) max ans S print(ans) print ans S = sum(prospect[:K]) sum(prospect[:K]) S S += prospect[k+K] - prospect[k] prospect[k+K] - prospect[k] S ans = 0 + S 0 + S ans ans = max(ans, S) max(ans, S) ans K = map(int, input().split()) map(int, input().split()) K p = list(map(int, input().split())) list(map(int, input().split())) p prospect = [] [] prospect N, K = map(int, input().split()) map(int, input().split()) N
N, K = map(int, input().split())
p = list(map(int, input().split()))
prospect = []
for k in range(N):
  if p[k]%2 == 1:
    prospect.append((p[k]+1)>>1)
  else:
    prospect.append((p[k]+1)/2)
S = sum(prospect[:K])
ans = 0 + S
for k in range(N-K):
  S += prospect[k+K] - prospect[k]
  ans = max(ans, S)
print(ans) 