expected = {}

n, k = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

max_sum = 0
for i in range(k):
  max_sum += p[i]
  
last_sum = max_sum
max_init_index = 0

for i in range(1, n - k + 1):
  current_sum = last_sum - p[i - 1] + p[i + k - 1]
  if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
  last_sum = current_sum

for i in range(1, 1001):
  expected[i] = 1 + (i - 1)/2

ans = 0
for i in range(max_init_index, max_init_index + k):
  ans += expected[p[i]]

print(ans)
  
 expected = {} expected {} 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(" ")] max_sum = 0 max_sum 0 for i in range(k):
  max_sum += p[i]
   i range(k) range k max_sum += p[i] max_sum p[i] p i last_sum = max_sum last_sum max_sum max_init_index = 0 max_init_index 0 for i in range(1, n - k + 1):
  current_sum = last_sum - p[i - 1] + p[i + k - 1]
  if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
  last_sum = current_sum i range(1, n - k + 1) range 1 n - k + 1 n - k n k 1 current_sum = last_sum - p[i - 1] + p[i + k - 1] current_sum last_sum - p[i - 1] + p[i + k - 1] last_sum - p[i - 1] last_sum p[i - 1] p i - 1 i 1 p[i + k - 1] p i + k - 1 i + k i k 1 if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
   max_sum < current_sum max_sum current_sum max_sum = current_sum max_sum current_sum max_init_index = i max_init_index i last_sum = current_sum last_sum current_sum for i in range(1, 1001):
  expected[i] = 1 + (i - 1)/2 i range(1, 1001) range 1 1001 expected[i] = 1 + (i - 1)/2 expected[i] expected i 1 + (i - 1)/2 1 (i - 1)/2 i - 1 i 1 2 ans = 0 ans 0 for i in range(max_init_index, max_init_index + k):
  ans += expected[p[i]] i range(max_init_index, max_init_index + k) range max_init_index max_init_index + k max_init_index k ans += expected[p[i]] ans expected[p[i]] expected p[i] p i print(ans) print ans last_sum = current_sum current_sum last_sum max_sum += p[i] p[i] max_sum max_init_index = 0 0 max_init_index k = [int(i) for i in input().split(" ")] [int(i) for i in input().split(" ")] k max_init_index = i i max_init_index max_sum = 0 0 max_sum current_sum = last_sum - p[i - 1] + p[i + k - 1] last_sum - p[i - 1] + p[i + k - 1] current_sum expected = {} {} expected ans = 0 0 ans ans += expected[p[i]] expected[p[i]] ans last_sum = max_sum max_sum last_sum max_sum = current_sum current_sum max_sum n, k = [int(i) for i in input().split(" ")] [int(i) for i in input().split(" ")] n p = [int(i) for i in input().split(" ")] [int(i) for i in input().split(" ")] p
expected = {}

n, k = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

max_sum = 0
for i in range(k):
  max_sum += p[i]
  
last_sum = max_sum
max_init_index = 0

for i in range(1, n - k + 1):
  current_sum = last_sum - p[i - 1] + p[i + k - 1]
  if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
  last_sum = current_sum

for i in range(1, 1001):
  expected[i] = 1 + (i - 1)/2

ans = 0
for i in range(max_init_index, max_init_index + k):
  ans += expected[p[i]]

print(ans)
  

