Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])+K
  else:
    if p_list[i-1] < p_list[i-1+K]:
      tmp = sum(p_list[i:i+K])+K
      if max_sum < tmp:
        max_sum = tmp

print(max_sum/2)

Fixed submission:
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)

Buggy python submission (verdict: Runtime Error):
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if (i+K > N) or (p_list[i-1] >= p_list[i-1+K]):
    break

  if i == 0:
    max_sum = sum(p_list[0:K])+K
  else:
    tmp = sum(p_list[i:i+K])+K
    if max_sum < tmp:
      max_sum = tmp

print(max_sum/2)


Fixed submission:
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])+K
  else:
    if p_list[i-1] < p_list[i-1+K]:
      tmp = sum(p_list[i:i+K])+K
      if max_sum < tmp:
        max_sum = tmp

print(max_sum/2)

Fixed submission:
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])+K
  else:
    tmp = sum(p_list[i:i+K])+K
    if max_sum < tmp:
      max_sum = tmp

print(max_sum/2)

Fixed submission:
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

max_index = 0
max_sum = -10000
for i in range(0, N):
  if i+K > N:
    break
  tmp = sum(p_list[i:i+K])
  if tmp > max_sum:
    max_sum = tmp
    max_index = i

avg = 0
for i in range(max_index, max_index+K):
  avg += (p_list[i]+1) / 2

print(avg)


Fixed submission:
N, K = input().split(" ")
N, K = int(N), int(K)
p_list = [int(i) for i in input().split(" ")]

for i in range(0, N):
  if i+K > N:
    break

  if i == 0:
    max_sum = sum(p_list[0:K])
    now_sum = max_sum
  else:
    now_sum += (p_list[i-1+K] - p_list[i-1])
    if max_sum < now_sum:
      max_sum = now_sum

print((max_sum + K)/2)