Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum
            
print(ksum)
time3 = datetime.now()

       




Fixed submission:
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum


print(mmax)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
PP = tuple(map(int,input().split()))

mind = -1
mmax = -1

for i in range(N-K+1):
    ksum = sum(PP[i:i+(K)])
    if ksum > mmax:
        mind = i
        mmax = ksum
        
        
maxrange = PP[mind:(mind+K)]

esum = 0
for m in maxrange:
    esum += (m+1)/2
    
print(esum)


Fixed submission:
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum


print(mmax)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
PP = tuple(map(int,input().split()))

mind = -1
mmax = -1

for i in range(N-K+1):
    ksum = sum(PP[i:i+(K)])
    if ksum > mmax:
        mind = i
        mmax = ksum
        
        
maxrange = PP[mind:(mind+K)]

esum = 0
for m in maxrange:
    esum += (m+1)/2
    
print(esum)


Fixed submission:
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum


print(mmax)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
PP = list(map(int,input().split()))

maxpair = (-1,-1)

for i in range(N-K+1):
    ksum = sum(PP[i:i+(K)])
    if ksum > maxpair[1]:
        maxpair = (i,ksum)
        
        
mp = maxpair[0]        
maxrange = PP[mp:(mp+K)]

esum = 0
for m in maxrange:
    esum += (m+1)/2
    
print(esum)


Fixed submission:
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum


print(mmax)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
PP = list(map(int,input().split()))

maxpair = (-1,-1)

for i in range(N-K+1):
    ksum = sum(PP[i:i+(K)])
    if ksum > maxpair[1]:
        maxpair = (i,ksum)
        
mp = maxpair[0]        
maxrange = PP[mp:(mp+K)]

esum = 0
for m in maxrange:
    esum += (m+1)/2
    
print(esum)


Fixed submission:
N,K = map(int,input().split())
PP = list(map(int,input().split()))


mind = -1
mmax = -1

sums = []
csum = 0

for i in range(N):
    p = PP[i]
    csum += (p+1)/2
    sums.append(csum)
    if i < K:
        if mmax < csum:
            mind = i
            mmax = csum
    else:
        ksum = csum - sums[(i-K)]
        if mmax < ksum:
            mind = i
            mmax = ksum


print(mmax)