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

prev = 0
ind = 0

for i in range(n - k + 1):
    nex = sum(p[i:i + k])

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (p[i] * 0.5 + 0.5)

print(total)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

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

prev = 0
ind = 0

for i in range(n - k + 1):
    nex = sum(p[i:i + k])

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (p[i] * 0.5 + 0.5)

print(total)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

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

prev = sum(p[1:k])
ind = 0


for i in range(n - k + 1):
    nex = sum(p[i:i + k])

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (1 + p[i]) * (p[i] / 2) / p[i]

print(total)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = tuple(map(int, input().split()))

prev = 0
ind = 0
for i in range(n - k + 1):
    nex =  sum(p[i:i+k])

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (1 + p[i]) * (p[i] / 2) / p[i]

print(total)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = tuple(map(int, input().split()))

prev = 0
ind = 0
for i in range(n - k + 1):
    nex = 0
    for j in range(i, i + k):
        nex += p[j]

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (1 + p[i]) * (p[i] / 2) / p[i]

print(total)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = tuple(map(int, input().split()))

prev = 0
ind = 0
for i in range(n - k + 1):
    nex = 0
    for j in range(i, i + k):
        nex += p[j]

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind, ind + k):
    total += (1 + p[i]) * (p[i] / 2) / p[i]

print(total)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)

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

prev = 0
ind = 0
for i in range(n-k+1):
    nex = 0
    for j in range(i,i+k):
        nex += p[j]

    if prev < nex:
        prev = nex
        ind = i

total = 0
for i in range(ind,ind+k):
    total += (sum(tuple(range(1, p[i]+1))))/p[i]

print(total)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

prev = sum(p[1:k])
current = sum(p[1:k])
ind = 0

for i in range(1, n - k + 1):
    current = current - p[i - 1] + p[i + k - 1]

    if prev < current:
        prev = current
        ind = i

total = 0
for i in range(ind, ind + k):
    total += p[i] / 2 + 0.5

print(total)