Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = deque([])
ans = 0

for i in range(n):
  ave.append((p[i]+1)/2)
  if len(ave) == k:
    ans = max(ans,sum(ave))
    ave.popleft()


print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = deque([])
ans = 0

for i in range(n):
  ave.append((p[i]+1)/2)
  if len(ave) == k:
    ans = max(ans,sum(ave))
    ave.popleft()


print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
s = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for i in range(n-k+1):
  for j in range(i,i+k):
    s += ave[j]
  ans = max(ans,s)
  s = 0

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for i in range(n-k+1):
  ans = max(ans,sum(ave[i:i+k]))

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for i in range(n-k+1):
  ans = max(ans,sum(ave[i:i+k]))

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []

for i in range(n):
  ave.append((p[i]+1)/2)

for i in range(n-k+1):
  ans = max(ans,sum(ave[i:i+k]))

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ave = []
ans = 0
tmp = 0

for i in range(n):
  ave.append((p[i]+1)/2)

for j in range(n):
  tmp += ave[j]
  if j >= k:
    tmp -= ave[j-k]
    
  ans = max(ans,tmp)


print(ans)