Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
np_p = np.array(p)

#sumを呼び出す
def my_sum(i, k):
    return ((np_p[i:i+k]+1)/2).sum()

def main3():
    ans = 0
    for i in range(n-k+1):
        ans = max(ans, my_sum(i, k))
    print(ans)

main3()

Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
np_p = np.array(p)

def main2():
    ans = 0
    for i in range(n-k+1):
        ans = max(ans, ((np_p[i:i+k]+1)/2).sum())
    print(ans)

main2()


Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
np_p = np.array(p)

def main():
    keep_val = 0
    check = 0
    for i in range(n-k+1):
        ss = np_p[i:i+k].sum()
        if keep_val < ss:
            check = i
            keep_val = ss
    print(((np_p[check:check+k]+1)/2).sum())
main()

Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
np_p = np.array(p)

keep_val = 0
check = 0
for i in range(n-k+1):
    ss = np_p[i:i+k].sum()
    if keep_val < ss:
        check = i
        keep_val = ss
print(((np_p[check:check+k]+1)/2).sum())

Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Runtime Error):

# -*- coding: utf-8 -*-
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
np_p = np.array(p)

def main():
    keep_val = 0
    check = 0
    for i in range(n-k+1):
        ss = np_p[i:i+k].sum()
        if keep_val < ss:
            check = i
            keep_val = ss
    print(((np_p[check:check+k]+1)/2).sum())
main()


Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

def main():
    keep_val = 0
    check = 0
    for i in range(n-k+1):
        ss = sum(p[i:i+k])
        if keep_val < ss:
            check = i
            keep_val = ss

    #print(p[check:check+k])

    ans = 0
    for i in p[check:check+k]:
        ans += (i+1)/2
    print(ans)

main()


Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

keep_val = 0
check = 0
for i in range(n-k+1):
    ss = sum(p[i:i+k])
    if keep_val < ss:
        check = i
        keep_val = ss

#print(p[check:check+k])

ans = 0
for i in p[check:check+k]:
    ans += (i+1)/2
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

keep_val = 0
check = 0
for i in range(n-k+1):
    if keep_val < sum(p[i:i+k]):
        check = i
        keep_val = sum(p[i:i+k])

#print(p[check:check+k])

ans = 0
for i in p[check:check+k]:
    ans += (i+1)/2
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
p = list(map(int, input().split()))

summation = 0
exp_val = []
for i in range(n):
    summation += (p[i]+1)/2
    exp_val.append(summation)
exp_val.insert(0, 0)
#print(exp_val)

ans = 0
for i in range(n-k+1):
    m = exp_val[k+i] - exp_val[i]
    ans = max(ans, m)

print(ans)