from functools import reduce
n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
tmp_max = sum([i / 2 + 0.5 for i in p[0:k]])
tmp = tmp_max
idx = 0
for i in range(1, len(p) - k + 1):
	tmp -= p[i - 1] / 2 + 0.5
	if i + k - 1 < len(p):
		tmp += p[i + k - 1] / 2 + 0.5
	tmp_max = max(tmp_max, tmp)
print(tmp_max) from functools import reduce int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i n, k = [int(i) for i in input().split()] n [int(i) for i in input().split()] k int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i p = [int(i) for i in input().split()] p [int(i) for i in input().split()] i / 2 + 0.5 for i in p[0:k] for i in p[0:k] i p[0:k] p 0:k 0 k for i in p[0:k] i / 2 + 0.5 i / 2 i 2 0.5 tmp_max = sum([i / 2 + 0.5 for i in p[0:k]]) tmp_max sum([i / 2 + 0.5 for i in p[0:k]]) sum [i / 2 + 0.5 for i in p[0:k]] tmp = tmp_max tmp tmp_max idx = 0 idx 0 for i in range(1, len(p) - k + 1):
	tmp -= p[i - 1] / 2 + 0.5
	if i + k - 1 < len(p):
		tmp += p[i + k - 1] / 2 + 0.5
	tmp_max = max(tmp_max, tmp) i range(1, len(p) - k + 1) range 1 len(p) - k + 1 len(p) - k len(p) len p k 1 tmp -= p[i - 1] / 2 + 0.5 tmp p[i - 1] / 2 + 0.5 p[i - 1] / 2 p[i - 1] p i - 1 i 1 2 0.5 if i + k - 1 < len(p):
		tmp += p[i + k - 1] / 2 + 0.5
	 i + k - 1 < len(p) i + k - 1 i + k i k 1 len(p) len p tmp += p[i + k - 1] / 2 + 0.5 tmp p[i + k - 1] / 2 + 0.5 p[i + k - 1] / 2 p[i + k - 1] p i + k - 1 i + k i k 1 2 0.5 tmp_max = max(tmp_max, tmp) tmp_max max(tmp_max, tmp) max tmp_max tmp print(tmp_max) print tmp_max p = [int(i) for i in input().split()] [int(i) for i in input().split()] p tmp = tmp_max tmp_max tmp tmp += p[i + k - 1] / 2 + 0.5 p[i + k - 1] / 2 + 0.5 tmp k = [int(i) for i in input().split()] [int(i) for i in input().split()] k tmp_max = max(tmp_max, tmp) max(tmp_max, tmp) tmp_max tmp_max = sum([i / 2 + 0.5 for i in p[0:k]]) sum([i / 2 + 0.5 for i in p[0:k]]) tmp_max n, k = [int(i) for i in input().split()] [int(i) for i in input().split()] n idx = 0 0 idx tmp -= p[i - 1] / 2 + 0.5 p[i - 1] / 2 + 0.5 tmp
from functools import reduce
n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
tmp_max = sum([i / 2 + 0.5 for i in p[0:k]])
tmp = tmp_max
idx = 0
for i in range(1, len(p) - k + 1):
	tmp -= p[i - 1] / 2 + 0.5
	if i + k - 1 < len(p):
		tmp += p[i + k - 1] / 2 + 0.5
	tmp_max = max(tmp_max, tmp)
print(tmp_max)