Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))

window = sum(A[0:K])
max_s = 0
for i in range(N - K):
    window -= A[i]
    window += A[i + K]
    sum_w = sum(window)
    if sum_w > max_s:
        max_s = sum_w
print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 200000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)


Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Runtime Error):
s = [0] * 200000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
s = [0] * 200000
for i in range(N):
    s[i+1] = s[i] +A[i]

max_s = 0
for i in range(K):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = []
s = [0] * 200000
for i in range(K):
  a_k = int(input())
  s[i+1] = s[i] + a_k

max_s = 0
for i in range(K)
  if max_s < s[i+K] - s[i]:
    max_s = s[i+K] - s[i]
print(max_s)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

max_s = 0
for i in range(N):
  if i+K < N and P[i] < P[i+K]:
    i = i + K
    continue
    
  sum_K = sum(P[0+i:K+i])
  if max_s < sum_K:
    max_s = sum_K

print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

max_s = 0
for i in range(N):
  if i+K < N and P[i] < P[i+K]:
    continue
  elif i+K > N:
    continue
  sum_K = sum(P[0+i:K+i])
  if max_s < sum_K:
    max_s = sum_K
print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

max_s = 0
len_P = len(P)
for i in range(len_P):
  if i+K < len_P and P[i] < P[i+K]:
    continue
  sum_K = sum(P[0+i:K+i])
  if max_s < sum_K:
    max_s = sum_K
print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

max_s = 0
for i in range(len(P)):
	sum_K = sum(P[0+i:K+i])
	if max_s < sum_K:
  		max_s = sum_K
print((max_s+K) / 2)

Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)