Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

ans = 0
tmp = 0
for i in range(k):
    ans += sum([i for i in range(1, p[i] + 1)]) / p[i]
    tmp = ans
#print(ans)
for i in range(n - k):
    tmp = tmp + (sum([i for i in range(1, p[i + k] + 1)]) / p[i + k]) - (sum([i for i in range(1, p[i] + 1)]) / p[i])
    #print(p[i], p[i + k], tmp)
    #print(p[i], sum([i for i in range(1, p[i] + 1)]) / p[i])
    #print(p[i + k], sum([i for i in range(1, p[i + k] + 1)]) / p[i + k])
    if tmp > ans:
        ans = tmp
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
tmp = 0
for i in range(k):
    tmp += kitai[i]
ans = tmp
for i in range(n - k):
    tmp = tmp - kitai[i] + kitai[i + k]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

ans = 0
tmp = 0
for i in range(k):
    ans += sum([i for i in range(1, p[i] + 1)]) / p[i]
    tmp = ans
#print(ans)
for i in range(n - k):
    tmp = tmp + (sum([i for i in range(1, p[i + k] + 1)]) / p[i + k]) - (sum([i for i in range(1, p[i] + 1)]) / p[i])
    #print(p[i], p[i + k], tmp)
    #print(p[i], sum([i for i in range(1, p[i] + 1)]) / p[i])
    #print(p[i + k], sum([i for i in range(1, p[i + k] + 1)]) / p[i + k])
    if tmp > ans:
        ans = tmp
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
tmp = 0
for i in range(k):
    tmp += kitai[i]
ans = tmp
for i in range(n - k):
    tmp = tmp - kitai[i] + kitai[i + k]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
for i in range(n - k + 1):
    tmp2 = 0
    for j in range(i, i + k):
        tmp2 += kitai[j]
    if ans < tmp2:
        ans = tmp2
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
tmp = 0
for i in range(k):
    tmp += kitai[i]
ans = tmp
for i in range(n - k):
    tmp = tmp - kitai[i] + kitai[i + k]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

kitai = []
for i in range(n):
    tmp = 0
    for j in range(1, p[i] + 1):
        tmp += j
    kitai.append(tmp / p[i])

ans = 0
for i in range(n - k + 1):
    tmp2 = 0
    for j in range(i, i + k):
        #print(j)
        #print(kitai[j])
        tmp2 += kitai[j]
    #print(tmp2)
    if ans < tmp2:
        ans = tmp2
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
tmp = 0
for i in range(k):
    tmp += kitai[i]
ans = tmp
for i in range(n - k):
    tmp = tmp - kitai[i] + kitai[i + k]
    if ans < tmp:
        ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

kitai = []
for i in range(n):
    tmp = 0
    for j in range(1, p[i] + 1):
        tmp += j
    kitai.append(tmp / p[i])

ans = 0
for i in range(n - k + 1):
    tmp2 = 0
    for j in range(i, i + k):
        #print(j)
        #print(kitai[j])
        tmp2 += kitai[j]
    #print(tmp2)
    if ans < tmp2:
        ans = tmp2
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
p = [int(i) for i in input().split()]

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

ans = 0
tmp = 0
for i in range(k):
    tmp += kitai[i]
ans = tmp
for i in range(n - k):
    tmp = tmp - kitai[i] + kitai[i + k]
    if ans < tmp:
        ans = tmp
print(ans)