Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = []
max_p = 0
for i in range(N):
  Es.append((ps[i]+1)/2)
  if i<(K-1):
    continue
  elif i==(K-1):
    max_p = sum(Es)
  else:
    Es.pop(0)
    p = sum(Es)
    if max_p < p:
      max_p = p
print(max_p)

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(N):
  if i<K:
    continue
  else:
    maxs.append(sum(Es[i-K:i]))
print(max(maxs))

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = np.array([sum(range(1, ps[i]+1))/ps[i] for i in range(N)], dtype=np.float64)
maxs = []
for i in range(N):
  if i<K:
    continue
  else:
    maxs.append(sum(Es[i-K:i]))
print(max(maxs))

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [sum(range(1, ps[i]+1))/ps[i] for i in range(N)]
maxs = []
for i in range(N):
  if i<K:
    continue
  else:
    maxs.append(sum(Es[i-K:i]))
print(max(maxs))

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [sum(range(1, ps[i]+1))/ps[i] for i in range(N)]
maxs = []
for i in range(N):
  if i<K:
    continue
  else:
    maxs.append(sum(Es[i:i+K]))
print(max(maxs))

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = []
for i in range(N):
  p = sum([i for i in range(1, ps[i]+1)])/ps[i]
  Es.append(p)
  if i<(K-1):
    continue
  elif i==(K-1):
    max_e = sum(Es)
  else:
    Es = Es[1:]
    if sum(Es)>max_e:
      max_e = sum(Es)
print(max_e)

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = []
for i in range(N):
  p = sum([i for i in range(1, ps[i]+1)])/ps[i]
  Es.append(p)
  if i<(K-1):
    continue
  elif i==(K-1):
    max_e = sum(Es)
  else:
    Es = Es[1:]
    if sum(Es)>max_e:
      max_e = sum(Es)
print(max_e)

Fixed submission:
N, K = map(int, input().split())
ps = list(map(int, input().split()))
Es = [(ps[i]+1)/2 for i in range(N)]
maxs = []
for i in range(1, N+1):
  if i<K:
    continue
  elif i==K:
    tmp = sum(Es[:i])
    maxs.append(tmp)
  else:
    tmp = tmp +Es[i-1]-Es[i-K-1]
    maxs.append(tmp)
print(max(maxs))