Buggy python submission (verdict: Time Limit Exceeded):
(n, k) = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

maxNum = -1
maxIndex = [0, 0]
for i in range(n-k+1):
  s = sum(p[i:i+k])
  if s > maxNum:
    maxNum = s
    maxIndex = [i, i+k]

dices = p[maxIndex[0]:maxIndex[1]]
exs = 0
for dice in dices:
  exs += sum(list(range(1, dice+1))) / dice
print(exs)

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

s = 0
sums = [0]
for i in p:
  	s += i
  	sums.append(s)

maxNum = -1
maxIndex = [0, 0]
for i in range(len(sums)-k):
  if sums[i+k] - sums[i] > maxNum:
    maxNum = sums[i+k] - sums[i]
    maxIndex = [i, i+k-1]

dices = p[maxIndex[0]:maxIndex[1]+1]
e = 0
for dice in dices:
  e += sum(list(range(1, dice+1))) / dice
print(e)

Buggy python submission (verdict: Time Limit Exceeded):
(n, k) = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

maxNum = -1
maxIndex = [0, 0]
for i in range(n-k+1):
  s = 0
  for j in range(i, i+k, 1):
    s += p[j]
  if s > maxNum:
    maxNum = s
    maxIndex = [i, i+k]

dices = p[maxIndex[0]:maxIndex[1]]
exs = 0
for dice in dices:
  e = 0
  for i in range(1, dice+1):
    e += i 
  exs += e /dice
print(exs)

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

s = 0
sums = [0]
for i in p:
  	s += i
  	sums.append(s)

maxNum = -1
maxIndex = [0, 0]
for i in range(len(sums)-k):
  if sums[i+k] - sums[i] > maxNum:
    maxNum = sums[i+k] - sums[i]
    maxIndex = [i, i+k-1]

dices = p[maxIndex[0]:maxIndex[1]+1]
e = 0
for dice in dices:
  e += sum(list(range(1, dice+1))) / dice
print(e)

Buggy python submission (verdict: Time Limit Exceeded):
(n, k) = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]


maxNum = -1
maxIndex = [0, 0]
for i in range(n-k+1):
  s = 0
  for j in range(i, i+k, 1):
    s += p[j]
  if s > maxNum:
    maxNum = s
    maxIndex = [i, i+k]

dices = p[maxIndex[0]:maxIndex[1]]
exs = 0
for dice in dices:
  e = 0
  for i in range(1, dice+1):
    e += i / dice
  exs += e
print(exs)

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

s = 0
sums = [0]
for i in p:
  	s += i
  	sums.append(s)

maxNum = -1
maxIndex = [0, 0]
for i in range(len(sums)-k):
  if sums[i+k] - sums[i] > maxNum:
    maxNum = sums[i+k] - sums[i]
    maxIndex = [i, i+k-1]

dices = p[maxIndex[0]:maxIndex[1]+1]
e = 0
for dice in dices:
  e += sum(list(range(1, dice+1))) / dice
print(e)

Buggy python submission (verdict: Time Limit Exceeded):
(n, k) = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

exs = []
for i in range(n-k+1):
  exsum = 0
  for j in range(i, i+k, 1):
    ex = 0
    for l in range(1, p[j]+1, 1):
      ex += l / p[j]
    exsum += ex
  exs.append(exsum)
print(max(exs))

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

s = 0
sums = [0]
for i in p:
  	s += i
  	sums.append(s)

maxNum = -1
maxIndex = [0, 0]
for i in range(len(sums)-k):
  if sums[i+k] - sums[i] > maxNum:
    maxNum = sums[i+k] - sums[i]
    maxIndex = [i, i+k-1]

dices = p[maxIndex[0]:maxIndex[1]+1]
e = 0
for dice in dices:
  e += sum(list(range(1, dice+1))) / dice
print(e)