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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)


 
 
ans = 0
for j in range(n - k + 1):
    sums = 0
    for z in range(j,j + k):
        sums += saikoro[p[z]] / p[z]
    ans = max(ans, sums)
 
print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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

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

ruiseki = [0] * 1001
for i in range(1, 1001):
    ruiseki[i] = ruiseki[i-1] + i

dp = [0] * n
for i in range(k - 1, n):
    for j in range(i + 1 - k, i + 1):
        dp[i] += p[j]

maxs = max(dp)
index = dp.index(maxs)

ans = 0
for l in range(index + 1 - k,index + 1):
    ans += ruiseki[p[l]] / p[l]

print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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

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


dp = [0] * n
for i in range(k - 1, n):
    for j in range(i + 1 - k, i + 1):
        dp[i] += p[j]

maxs = max(dp)
index = dp.index(maxs)

ans = 0
for l in range(index + 1 - k,index + 1):
    ans += sum([z for z in range(1, p[l] + 1)]) / p[l]

print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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

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


ans = 0
for j in range(n - k + 1):
    sums = 0
    for z in range(j,j + k):
        sums += sum([l for l in range(1, p[z] + 1)]) / p[z]
    ans = max(ans, sums)

print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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

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


ans = 0
for j in range(n - k + 1):
    sum = 0
    for z in range(j,j + k):
        sum += sum([j for j in range(1, p[z] + 1)]) / p[z]
    ans = max(ans, sum)

print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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

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

ex = [0] * n
for i in range(n):
    ex[i] += sum([j for j in range(1, p[i] + 1)]) / p[i]

ans = 0
for j in range(n - k + 1):
    sum = 0
    for z in range(j,j + k):
        sum += ex[z]
    ans = max(ans, sum)

print(ans)

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

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