Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


def kitaichi(num):
    return ((num+1)/ 2)

t = [0] * n
for i in range(n):
    t[i] = kitaichi(p[i])

ans = 0
for i in range(n-k+1):
    tmp = sum([t[x] for x in range(i, i+k)])
    ans = max(ans,tmp)

print(ans)

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


def kitaichi(num):
    return (sum(range(num+1)) / num)

t = [0] * n
for i in range(n):
    t[i] = kitaichi(p[i])

ans = 0
for i in range(n-k+1):
    tmp = sum([t[x] for x in range(i, i+k)])
    ans = max(ans,tmp)

print(ans)

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = tuple(int(x) for x in input().split())


def kitaichi(num):
    return (sum(range(num+1)) / num)


tmp = 0
tmp_i = 0
for i in range(n-k+1):
    a = sum(tuple(p[x] for x in range(i, i+k)))
    if a > tmp:
        tmp = a
        tmp_i = i

ans = tuple(kitaichi(p[tmp_i+x]) for x in range(k))
print(sum(ans))

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


def kitaichi(num):
    return (sum(range(num+1)) / num)


tmp = 0
tmp_i = 0
for i in range(n-k+1):
    a = sum([p[x] for x in range(i, i+k)])
    if a > tmp:
        tmp = a
        tmp_i = i

ans = [kitaichi(p[tmp_i+x]) for x in range(k)]
print(sum(ans))

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


def kitaichi(num):
    return (sum(range(num+1)) / num)


tmp = 0
tmp_i = 0
for i in range(n-k+1):
    a = sum([p[x] for x in range(i, i+k)])
    if a > tmp:
        tmp = a
        tmp_i = i

ans = 0
for x in range(k):
    ans += kitaichi(p[tmp_i+x])

print(ans)

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0]*(n-k+1)
tmp = 0
for i in range(n-k+1):
    for x in range(k):
        num = p[i+x]
        tmp += sum(range(num+1)) / num
    t[i] = tmp
    tmp = 0

print(max(t))

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]

tmp = 0
tmp_i = 0
for i in range(n-k+1):
    a = sum([p[x] for x in range(i, i+k)])
    if a > tmp:
        tmp = a
        tmp_i = i

ans = 0
for x in range(k):
    num = p[tmp_i+x]
    ans += sum(range(num+1)) / num

print(ans)

Fixed submission:
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]


t = [0] * (n+k+1)
for i in range(n):
    t[i+1] = t[i] + p[i]

ans = 0
for i in range(n):
    ans = max(ans, t[i+k]-t[i])
print((ans+k)/2)