Buggy python submission (verdict: Runtime Error):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

dice_total = [0]

for i in range(total):
  dice_total.append(dice_array[i] + dice_total[i])

ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp
    tar_num = i + 1

sum_data = 0
cnt = 0
for x in range(tar_num, tar + tar_num):
  sum_data += (dice_array[x] * (dice_array[x] + 1)) / 2 / dice_array[x]
  
print(sum_data)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Runtime Error):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

dice_total = [0]

for i in range(total):
  dice_total.append(dice_array[i] + dice_total[i])

ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp
    tar_num = i + 1

sum_data = 0
cnt = 0
for x in range(tar_num, tar + tar_num):
  cnt = sum(list(range(1, dice_array[x] + 1)))
  sum_data += (cnt / dice_array[x])
  
print(sum_data)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Runtime Error):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

dice_total = [0]

for i in range(total):
  dice_total.append(dice_array[i] + dice_total[i])

ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    tmp = ans
    tar_num = i + 1

sum_data = 0
cnt = 0
for x in range(tar_num, tar + tar_num):
  cnt = sum(list(range(1, dice_array[x] + 1)))
  sum_data += (cnt / dice_array[x])
  
print(sum_data)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

tar2 = 0
calc_before = 0
calc_now = 0
for i in range(total+1-tar):
  calc_now = sum(dice_array[i:i+tar])
  if calc_before < calc_now:
    tar2 = i
    calc_before = calc_now
  calc_now = 0

sum_data = 0
cnt = 0
for i in range(tar2, tar+tar2):
  cnt = sum(list(range(1, dice_array[i] + 1)))
  sum_data += (cnt / dice_array[i])
  
print(sum_data)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))
l = [] * total

tar2 = 0
calc_before = 0
calc_now = 0
for i in range(total+1-tar):
  calc_now = sum(dice_array[i:i+tar])
  if calc_before < calc_now:
    tar2 = i
    calc_before = calc_now
  calc_now = 0

sum_data = 0
cnt = 0
for i in range(tar2, tar+tar2):
  cnt = sum(list(range(1, dice_array[i] + 1)))
  sum_data += (cnt / dice_array[i])
  
print(sum_data)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))
l = [] * total

tar2 = 0
calc_before = 0
calc_now = 0
for i in range(total+1-tar):
  calc_now = sum(dice_array[i:i+tar])
  if calc_before < calc_now:
    tar2 = i
    calc_before = calc_now
  calc_now = 0

sum = 0
for i in range(tar2, tar+tar2):
  cnt = 0
  for j in range(1, dice_array[i]+1):
    cnt += j
  sum += (cnt / dice_array[i])
  
print(sum)


Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))
l = [] * total

tar2 = 0
calc_before = 0
calc_now = 0
for i in range(total+1-tar):
  for j in range(tar):
    calc_now += dice_array[i + j]
  if calc_before < calc_now:
    tar2 = i
    calc_before = calc_now
  calc_now = 0
  
sum = 0
for i in range(tar2, tar+tar2):
  cnt = 0
  for j in range(1, dice_array[i]+1):
    cnt += j
  sum += (cnt / dice_array[i])
  
print(sum)

Fixed submission:
total, tar = list(map(int, input().split()))
dice_array = list(map(int, input().split()))

hope_array = [0.0] * total
for i in range(total):
   hope_array[i] = (dice_array[i] * (dice_array[i] + 1)) / 2 / dice_array[i]

dice_total = [0]
 
for i in range(total):
  dice_total.append(hope_array[i] + dice_total[i])
 
ans = dice_total[tar]
tar_num = tar
for i in range(total - tar):
  tmp = dice_total[i + 1 + tar] - dice_total[i + 1]
  if ans < tmp:
    ans = tmp

print(ans)