Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
for i in range(1, N-K+1):
    e = sum(P[i:i+K])
    if ans < e:
        ans = e
print(ans)

Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
q =[]
ans = 0

for p in [int(n) for n in input().split()]:
    if len(q) < K:
        q.append((p-1)/2+1)
    else:
        m = sum(q)
        if m > ans:
            ans = m
        q.append((p-1)/2+1)
        q.pop(0)
print(ans if ans>sum(q) else sum(q))


Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
P =  [int(n) for n in input().split()]
q =[]
ans = 0

for p in P:
    if len(q) < K:
        q.append((p-1)/2+1)
    else:
        m = sum(q)
        if m > ans:
            ans = m
        q.append((p-1)/2+1)
        q.pop(0)
print(ans if ans>sum(q) else sum(q))

Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
P =  [int(n) for n in input().split()]
o = {}
q =[]
ans = 0

def e(x):
    if x in o: return o[x]
    o[x] = sum([(j/x) for j in range(1,x+1)])
    return o[x]

for p in P:
    if len(q) < K:
        q.append(e(p))
    else:
        m = sum(q)
        if m > ans:
            ans = m
        q.append(e(p))
        q.pop(0)
print(ans if ans>sum(q) else sum(q))

Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
P =  [int(n) for n in input().split()]
o = {}
for i in range(1,1001):
    o[i] = sum([(j/i) for j in range(1,i+1)])
ans = 0
for k in range(N-K+1):
    m = sum([o[x] for x in P[k:k+K]])
    if m > ans:
        ans = m
print(ans)

Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(n) for n in input().split()]
P =  [int(n) for n in input().split()]
o = {}
for i in range(1,1001):
    o[i] = sum([(j/i) for j in range(1,i+1)])
ans = 0
for k in range(N-K+1):
    m = sum([o[x] for x in P[k:k+K]])
    if m > ans:
        ans = m
print(ans)
    

Fixed submission:
N, K = [int(n) for n in input().split()]
P = [(int(n)+1)/2 for n in input().split()]
ans = sum(P[:K])
e = ans
for p,x in zip(P, P[K:]):
    e = e-p+x
    if ans < e:
        ans = e
print(ans)