Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]
le = len(li)
if k == 1:
  print(max(li))
else:
  li2 = [sum(li[m:m+k]) for m in range(0, le - k + 1, 1)]
  print(max(li2))

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  li2 = [sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)]
  print(max(li2))

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

li2 = sorted([sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)], reverse=True)

print(li2[0])

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]
li2 = [sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)]

print(max(li2))

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
def expe(x):
  a = 1.0
  for i in range(1, x, 1):
    a += i / x
  return a

n, k = map(int, input().split())
li = [expe(int(j)) for j in input().split()]
li2 = [sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)]

print(max(li2))

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)

Buggy python submission (verdict: Time Limit Exceeded):
def expe(x):
  l = [i/x for i in range(1, x, 1)] + [1.0]
  return sum(l)

n, k = map(int, input().split())
li = [expe(int(j)) for j in input().split()]
li2 = [sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)]

print(max(li2))

Fixed submission:
n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)