peterverebics/CodeNet_Python_118 huggingface dataset:
n, k = map(int, input().split())
P = list(map(int, input().split()))

P_ac = [sum(P[:k])]
for i in range(n-k):
    P_ac.append(P_ac[-1]-P[i]+P[i+k])

print((max(P_ac)+k)/2)
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[0]*(n+1)
for i in range(n):
    x=p[i]
    s[i+1]=(x+1)/2+s[i]
ans=0
for i in range(k,n+1):
    ans=max(ans,s[i]-s[i-k])
print(ans)
from itertools import accumulate

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

exp={}
cum=[]

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

for i in p:
    cum.append(exp[i])

cumsum=list(accumulate(cum))
cumsum.insert(0,0)

for i in range(n-k+1):
    tmp = cumsum[i+k] - cumsum[i]
    if ans <= tmp:
        ans = tmp

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

ans = sum(p[:k])/2 + k/2
s = ans

for i in range(n-k):
    s = s - p[i]/2 + p[i+k]/2
    ans = max(ans,s)
print(ans)
N,K = map(int,input().split()) #KはN以下
P = list(map(int,input().split()))
for i,p in enumerate(P):
    P[i] = (p+1)/2
q = [0]
for p in P:
    q.append(q[-1]+p)
s,e = 0,K
ans = q[K]-q[0]
while e<len(q):
    ans = max(ans,q[e]-q[s])
    s += 1
    e += 1
print(ans)
N,K=map(int,input().split())
p=list(map(int,input().split()))
su=[0]
for i in range(N):
    p[i]=((p[i]+1)/2)
    su.append(su[i]+p[i])
ans=0
for i in range(K,N+1):
    ans=max(ans,su[i]-su[i-K])
print(ans)
def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))
    E = list(map(lambda x: (1+x)/2, P))
    tmp = sum(E[:K])
    ans = tmp
    for i in range(K, N):
        tmp += E[i] - E[i-K]
        ans = max(ans, tmp)
    print(ans)


if __name__ == "__main__":
    main()
n, k = map(int, input().split())
P = list(map(int, input().split()))
ans = 0
E = []

for p in P:
    E.append(p*(p+1)/(2*p))

cumsumE = [0]
for e in E:
    cumsumE.append(cumsumE[-1] + e)

for i in range(0, n+1-k):
    ans = max(ans, cumsumE[i+k]-cumsumE[i])
print(ans)
def main():
    N,K = map(int, input().split())
    p = list(map(int, input().split()))

    temp = 0
    for k in range(K):
        temp += calc_e(p[k])
    res = temp
    for n in range(N-K):
        temp -= calc_e(p[n])
        temp += calc_e(p[n+K])
        if(temp > res): res = temp
    print(res)


def calc_e(pi):
    return(sum(range(1,pi+1))/pi)

if __name__ == "__main__":
    main()
N, K = map(int, input().split())
p = [int(a) for a in input().split()]

B = [0]*(N-K+1)
B[0] = sum(p[0:K])
for i in range(1, N-K+1):
    B[i] = B[i-1] - p[i-1] + p[i+K-1]
    
max_ind = B.index(max(B))

ep = 0
for i in range(K):
    ep += (p[max_ind+i]*(p[max_ind+i]+1))/(2*p[max_ind+i])

print(ep)
N,K = map(int,input().split())
p = list(map(int,input().split()))
S = [0]
s = 0
Max = 0
for i in range(N):
    s += (p[i]+1)/2
    S.append(s)
for i in range(N-K+1):
    s = S[i+K] - S[i]
    if s > Max:
        Max = s
print(Max)
n,k=map(int,input().split())
P=list(map(int,input().split()))
S=[0]*(n+1)
S[1]=P[0]

for i in range(1,n):
    S[i+1]=S[i]+P[i]

ma=0
for i in range(k,n+1):
    s=S[i]-S[i-k]
    ma=max(ma,s)
print((ma+k)/2)
n, k = map(int, input().split())
A = list(map(int, input().split()))
B = [(1+i)/2 for i in A]
t = sum(B[:k])
ans = [t]
for i in range(n-k):
    t-=B[i]
    t+=B[i+k]
    ans.append(t)
print(max(ans))
n, k = map(int, input().split())
P = list(map(int, input().split()))

total = sum(P[:k])
tmp = total
start = 0
for i in range(0, n - k):
    tmp = tmp - P[i] + P[i + k]
    if total < tmp:
        total = tmp
        start = i + 1

ret = 0
for i in range(start, start + k):
    ret += (P[i] + 1) / 2

print(ret)
# coding: utf-8
# Your code here!

import sys
readline = sys.stdin.readline
read = sys.stdin.read


n,k,*p = [int(i) for i in read().split()]


p = [(1+i) for i in p]


m = a = sum(p[:k])
for i in range(k,n):
    a += p[i]
    a -= p[i-k]
    m = max(m,a)

print(m/2)
N,K=map(int,input().split())
p = list(map(int,input().split()))

ruisekiwa=[0]

for i in range(N):
    ruisekiwa.append(ruisekiwa[i]+(1+p[i])/2)

max_value=0
for i in range(N-K+1):
    tmp=ruisekiwa[i+K]- ruisekiwa[i]
    if(max_value < tmp):
        max_value=tmp
print(max_value)
def calc_e(num):
    return (num + 1) / 2

def main():
    n, k = map(int, input().split())
    dices = list(map(int, input().split()))

    current = (sum(dices[:k]) + k) / 2
    e_max = (sum(dices[:k]) + k) / 2
    for i in range(n-k):
        current = current + calc_e(dices[i+k]) - calc_e(dices[i])
        e_max = max(e_max, current)

    print(e_max)


if __name__ == '__main__':
    main()
from collections import defaultdict
d = defaultdict(int)

N, K = map(int, input().split())
li = list(map(int, input().split()))

for i in range(1, 1000+1):
  t = 0
  for s in range(1, i+1):
    t += s * (1 / i)

  d[i] = t

ans = 0
t = 0

for index, i in enumerate(li):
  t += d[i]

  if index > K-1:
    t -= d[li[index-K]]

  if ans < t:
    ans = t

print(ans)
N,K = map(int,input().split())
p = [int(x) for x in input().split()]

cnt = 0

for i in range(K):
    cnt += p[i]
ans = cnt
for i in range(1,N-K+1):
    cnt -= p[i-1]
    cnt += p[K+i-1]
    ans = max(cnt,ans)


print((ans+K)/2)
N, K = map(int, input().split())
p = list(map(int, input().split()))

a = [0 for _ in range(N+1)]

for i in range(N):
    a[i+1] = (1+p[i])/2 + a[i]

ans = 0

for i in range(N-K+1):
    ans = max(ans, a[i+K]-a[i])

# print(a)
print(ans)
N,K=list(map(int,input().split()))
P=list(map(int,input().split()))

E_P=[(1+p)/2 for p in P] 

E_P_sum=[0]
E_P_sum_=0
for n in range(N):
    E_P_sum_=E_P_sum_+E_P[n]
    E_P_sum.append(E_P_sum_)

max_ = 0
for k_ in range(len(P)-K+1):
    sum_=E_P_sum[k_+K]-E_P_sum[k_]
#     print(E_P_sum[k_+K],E_P_sum[k_],sum_)
    if max_ < sum_:
        max_=sum_
        
print(max_)
n, k = map(int, input().split())
p = list(map(int, input().split()))

if n != k:
    memo = [0] * (n + 1)

    for i in range(n):
        memo[i] = memo[i - 1] + p[i]

    ans = 0
    for i in range(k, n):
        ans = max(ans, memo[i] - memo[i - k])

    ans = (ans + k) / 2
    print(ans)
else:
    ans = (sum(p) + k) / 2
    print(ans)
from itertools import accumulate

N, K, *P = map(int, open(0).read().split())

E = [(p + 1) for p in P]

A = [0] + list(accumulate(E))

print("{:.8f}".format(max(A[i + K] - A[i] for i in range(N - K + 1)) / 2))
N,K= map(int,input().split())
p = list(map(int,input().split()))
sum1=0.0
for i in range (K):
    sum1=((p[i]+1)/2.0)+sum1
sum2=sum1
for i in range(N-K):
    sum1=sum1+((p[i+K]-p[i])/2.0)
    if sum1>sum2:
        sum2=sum1
print(sum2)
n,k = map(int,input().split())
li = list(map(int,input().split()))
mux = 0
s = 0

def div(n):
    return (n + 1)/2

for i in range(k):
    s += div(li[i])
mux = s 	

for i in range(k,len(li)):
    s -= div(li[i-k])
    s += div(li[i])
    if s > mux:
        mux = s
print(mux)
N, K = map(int, input().split())
A = list(map(int, input().split()))
P = pow(1 / 6, K)

now = sum(map(lambda a: a * (a + 1) // 2 / a, A[:K - 1]))
ans = 0
for left, right in zip(A, A[K - 1:]):
    now += right * (right + 1) // 2 / right
    ans = max(ans, now)
    now -= left * (left + 1) // 2 / left

print('{:.10f}'.format(ans))
N, K = map(int, input().split())
P = list(map(int, input().split()))
Pe = [(i+1)/2 for i in P]

maxsum = -1
cur = sum(Pe[0:K])
maxsum = cur
for i in range(1, N-K+1):
    cur = cur - Pe[i-1] + Pe[i+K-1]
    if cur > maxsum:
        maxsum = cur

print(maxsum)
N,K = map(int,input().split())
p = list(map(int,input().split()))

def kitaiti(n):
    return 0.5*n + 0.5

ans = 0

s=[0]*(N+1)
for i in range(N):
    s[i+1] = s[i] + p[i]

for i in range(N-K+1):
    val = s[K+i] - s[i]
    if ans<val:
        ans = val

print(kitaiti(ans)+0.5*(K-1))
a = [int(i) for i in input().split()]
b = [(int(i)+1)/2 for i in input().split()]

he = sum(b[:a[1]])
maxer = he
for i in range(a[0] - a[1]):
    he -= b[i]
    he += b[i + a[1]]
    maxer = max(he, maxer)

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

ls_mu = []
for i in range(n):
    mu = (p[i]+1)/2
    ls_mu.append(mu)
# print(ls_mu)
m = 0
M = 0
for i in range(n-k+1):
    if i==0:
        for j in range(k):
            m += ls_mu[j]
        M += m
    else:
        l = ls_mu[i-1]
        r = ls_mu[i+k-1]
        m = m - l + r
        M = max(m,M)

print(M)
def ave(n):
    return (n+1)/2

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

sum = 0

for i in range(k):
    sum += ave(p[i])

max_sum = sum

for i in range(n-k):
    sum -= ave(p[i])
    sum += ave(p[i+k])
    max_sum = max(sum, max_sum)

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

num = sum(p[:k])
ans = num/2 + 0.5*k
for i in range(k,n):
    num += p[i] - p[i-k]
    ans = max(ans,num/2 + 0.5*k)
print(ans)
n, k = map(int, input().split())
p = list(map(int,input().split()))

sum_p =[0]
tmp = 0
for i in p:
    tmp += i
    sum_p.append(tmp)

max_expect = 0
for i in range(k, n+1):
    tmp = sum_p[i] - sum_p[i - k]
    max_expect = max(tmp, max_expect)

ans = (k + max_expect)/2
print(ans)
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[]
for i in p:
  t=(1+i)
  s.append(t)
  
t=[0,]
for i in range(n):
  u=t[i]+s[i]
  t.append(u)

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

print('{:.10f}'.format(ans/2))
n,k = map(int,input().split())
l = list(map(int,input().split()))
ans = sum(l[:k])
tmp = ans
for i in range(k,n):
  tmp += l[i]-l[i-k]
  ans = max(ans, tmp)
print((ans+k)/2)
n,k = map(lambda x: int(x),input().split())
p = list(map(lambda x: (int(x) + 1)/2,input().split()))
ruiseki = [0]
max = 0
for i in range(n) :
    ruiseki.append(ruiseki[i]+p[i])

for j in range(n - k + 1):
    if max < (ruiseki[j+k] - ruiseki[j]) :
        max = (ruiseki[j+k] - ruiseki[j])


print(max)
n,k=map(int,input().split())
p=list(map(int,input().split()))
cnt=0
d=sum(p[:k])

for i in range(n-k):
    cnt=max(cnt,d)
    d+=p[i+k]-p[i]

cnt=max(cnt,d)

print((cnt+k)/2)
N,K = map(int, input().split())
lis = list(map(int, input().split()))

lis = [(ele+1)/2 for i, ele in enumerate(lis)]

ans_lis = []

ans_lis.append(sum(lis[0:K]))

for i in range(N-K):
    ele = ans_lis[-1] - lis[i] + lis[i+K]
    ans_lis.append(ele)
    
print(max(ans_lis))
N, K = map(int, input().split())
p = list(map(int, input().split()))

ans, ai = 0, -1
sum = 0
for i in range(N-K+1):
  if i == 0:
    for k in range(K):
      sum += p[i+k]
  else:
    sum = sum - p[i-1] + p[i+k]
  ans = max(ans, sum)
  if ans == sum:
    ai = i

dp = [0]*1001
dp[0] = 0
for i in range(1000):
  dp[i+1] = i+1 + dp[i]

ans = 0.0
for i in range(ai, ai+K):
  ans += dp[p[i]]/p[i]

print(ans)
def expectation(li):
  total = 0
  for i in li:
    total += (i+1)/2
  return total

n,k = map(int,input().split())
p = list(map(int,input().split()))
ex = expectation(p[0:k])
li = [ex]
for i in range(1,n-k+1):
  ex = ex - (p[i-1]+1)/2 + (p[i+k-1]+1)/2
  li.append(ex)
print(max(li))
import itertools

n, k = map(int, input().split())
dices = map(int, input().split())
dices_EV = list(map(lambda x:(x+1)/2, dices))
dices_EV_accumulate = list(itertools.accumulate(dices_EV))
dices_EV_sums = [dices_EV_accumulate[i+k] - dices_EV_accumulate[i] for i in range(n-k)]
dices_EV_sums.append(dices_EV_accumulate[k-1])
print(max(dices_EV_sums))
n,k=map(int,input().split())
p=list(map(int,input().split()))

tmp=0
for i in p[:k]:
    tmp+=(1+i)/2
li=[tmp]

for i in range(0,n-k):

    tmp=li[i]
    tmp-=(1+p[i])/2
    tmp+=(1+p[k+i])/2
    
    li.append(tmp)


print(max(li))
expected = {}

n, k = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

max_sum = 0
for i in range(k):
  max_sum += p[i]
  
last_sum = max_sum
max_init_index = 0

for i in range(1, n - k + 1):
  current_sum = last_sum - p[i - 1] + p[i + k - 1]
  if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
  last_sum = current_sum

for i in range(1, 1001):
  expected[i] = 1 + (i - 1)/2

ans = 0
for i in range(max_init_index, max_init_index + k):
  ans += expected[p[i]]

print(ans)
N, K = map(int, input().split())
p = list(map(int, input().split()))
rui = [0]
for tmp in p:
    tmp = (tmp + 1) / 2
    rui.append(tmp + rui[-1])

ans = 0
for i in range(0, N-K+1):
    ans = max(ans, rui[i+K] - rui[i])
print(ans)
import numpy as np

N, K= map(int, input().split())
p = np.array(list(map(int, input().split())))

tmp = np.sum(p[:K])
max = tmp
for i in range(N-K):
    tmp = tmp-p[i]+p[i+K]
    if tmp>max:
        max = tmp

print((max+K)/2)
N, K = [int(x) for x in input().split()]
P = [int(x) for x in input().split()]

def calc(n):
  return sum(range(1, n + 1)) / n

sums = [0]
s = 0
for i in range(N):
  s += calc(P[i])
  sums.append(s)

max_value = -1
max_index = -1

# print(sums)
for i in range(N - K + 1):
  s = sums[i+K] - sums[i]
  # print(i)
  # print(i+K)
  max_value = max(max_value, s)
  if max_value == s:
    max_index = i

print(max_value)
# print(sum([calc(P[i]) for i in range(max_index, max_index + K)]))
import numpy
N, K = map(int, input().split())
p = list(map(int, input().split()))

lis = list()

p = [(i + 1)/2 for i in p ]
numpy.set_printoptions(precision=16)

cumSum = numpy.cumsum(p)

cumSum2 = list(cumSum)

cumSum2.insert(0,0)

for i in range(0, N-K+1):
    lis.append(cumSum2[K+i] - cumSum2[i])

print('{:.12f}'.format(max(lis)))
#from math import sqrt
#from heapq import heappush, heappop
#from collections import deque

n, k = [int(v) for v in input().split()]
p = [int(v) for v in input().split()]

max_p = max(p)

dp = [0] * (max_p+1)
dp[1] = 1
for i in range(2, max_p+1):
    dp[i] = dp[i - 1] + i
    dp[i - 1] /= (i - 1)
dp[max_p] /= max_p

e = 0
for i in range(k):
    e += dp[p[i]]

max_e = e

for i in range(k, n):
    e -= dp[p[i - k]]
    e += dp[p[i]]
    max_e = max(max_e, e)

print(max_e)
N,K = list(map(int, input().split()))
p = list(map(int, input().split()))
max_l = 0
Max_l = p[0:K]
S = [0]
s=0
for j in range(N):
    s += p[j]
    S.append(s)

for i in range(N-K+1):
    m = S[K+i]-S[i]
    if m > max_l:
        max_l = m



print((max_l+K)/2)
n,k=map(int,input().split())
p=list(map(int,input().split()))
maxim=[0]*(n-k+1)
cnt=0
s=0
for i in range(n):
    cnt+=1
    s+=p[i]
    if cnt==k:
        maxim[i-(k-1)]=s
        cnt=k-1
        s+=-p[i-(k-1)]

ans=(max(maxim)+k)/2
print(ans)
N, K = map(int, input().split())
pN = list(map(int, input().split()))

ex_p = [(pi+1)/2 for pi in pN]
cum_p = [ex_p[0]]
for i in range(1,N):
    cum_p.append(cum_p[i-1]+ex_p[i])

max_ex = cum_p[K-1]
for i in range(1,N-K+1):
    if max_ex < cum_p[K+i-1] - cum_p[i-1]:
        max_ex = cum_p[K+i-1] - cum_p[i-1]

print(max_ex)
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

l = [i for i in range(1, 1001)]
av = np.cumsum(l) / l

tmp = [av[i - 1] for i in p]
cs = list(np.cumsum(tmp))

if n == k:
    print(cs[-1])
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans)
#!/usr/bin/env python3
def main():
    def expected_val(limit):
        return (1 + limit) / 2

    N, K = map(int, input().split())
    P = [int(x) for x in input().split()]

    lst = [0]
    res = 0
    for p in P:
        res += p + 1
        lst.append(res)
    ans = 0
    for i in range(N - K + 1):
        res = lst[i + K] - lst[i]
        ans = res if res > ans else ans
    print(ans / 2)


if __name__ == '__main__':
    main()
raw = input()
N, K = raw.split(' ')
N = int(N)
K = int(K)
str_li = input().split(' ')
num_li = list(map(int, str_li))
sum_li = [0]
for i in num_li:
    sum_li.append(sum_li[-1] + i + 1)
ans = 0
for index in range(K, N+1):
    ans_tmp = sum_li[index] - sum_li[index - K]
    if ans_tmp > ans:
        ans = ans_tmp
print(ans/2)
N, K = map(int, input().split())
p = [(int(x)+1)/2 for x in input().split()]
cm = [0]
for n in p:
    cm.append(cm[-1]+n)
ans = 0
for n in range(N-K+1):
    ans = max(cm[n+K]-cm[n],ans)
print(ans)
N, K = map(int, input().split())
dice = list(map(int, input().split()))
ma = 0
kitai = [0]*N
for i in range(N):
    kitai[i] = (((dice[i]+1)*dice[i])/2)/dice[i]
for i in range(K):
    ma += kitai[i]
tmp = ma
for i in range(K,N):
    tmp = tmp - kitai[i-K] + kitai[i]
    ma = max(tmp,ma)
print(ma)
N, K= map(int,input().split())
p = list(map(int,input().split()))

e = [(pi+1)/2 for pi in p]

f = sum(e[:K])
ans = f

for i in range(K,N):
    f = f - e[i-K] + e[i]
    ans = max(ans,f)

print(ans)
n,k = map(int, input().split())
p = list(map(int, input().split()))
m = sum(p[:k])
q = m
for i in range(n - k):
    q = q - p[i] + p[i + k]
    if q > m:
        m = q

print((k + m) / 2)
def main(N,K,p):
    sumi = 0
    ruiseki = [0] * (N+1)
    for i in range(N):
        ruiseki[i+1] = ruiseki[i] + p[i]
    for j in range(N-K+1):
        sumi = max(sumi, (ruiseki[j+K]-ruiseki[j]))
    return (sumi + K) / 2
N,K = map(int,input().split())
p = list(map(int,input().split()))
print(main(N,K,p))
N,K=map(int,input().split())
P=[0]+list(map(int,input().split()))

S=[0]*(N+1)
for i in range(1,N+1):
    S[i]=S[i-1]+P[i]

M=-1
for j in range(N-K+1):
    M=max(M,S[j+K]-S[j])
print((M+K)/2)
from collections import deque
N, K = map(int, input().split())
p = list(map(int, input().split()))
max_ans = 0
tmp_ans = 0
queue = deque([])
for i in range(N):
    e = (p[i] + 1) / 2 
    tmp_ans += e
    queue.append(e)
    if len(queue) > K:
        tmp_ans = tmp_ans - queue.popleft()
    max_ans = max(max_ans, tmp_ans)
print(max_ans)
N,K = map(int,input().split())
p = list(map(int,input().split()))
E = sum(p[0:K])
a = E
for i in range (0,N-K):
  E = E - p[i] + p[i+K]
  if E == max(a,E):
    a = E
    
print((a+K)/2)
N, K = map(int, input().split())
P = list(map(int, input().split()))


kitaiti = {}

k = 1.0
for i in range(1, 1001):
    kitaiti[i] = k
    k += 0.5

index = 0

for i in range(K):
    index += kitaiti[P[i]]

s = index
ans = index

for i in range(1, len(P)-K+1):
    s = index - kitaiti[P[i-1]] + kitaiti[P[i+K-1]]
    if s > ans: ans = s
    index = s
print(ans)
N,K = map(int, input().split())
# p[i]での出目の期待値
P = [(int(i) + 1) / 2 for i in input().split()]

from itertools import accumulate

P = [0] + list(accumulate(P))

ans = 0
for i in range(N - K + 1):
    ans = max(ans, P[i + K] - P[i])

print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
wa = sum(p[0:k])
next_wa = wa
for i in range(n-k):
    next_wa = next_wa - p[i] + p[i+k]
    if  next_wa > wa:
        wa = next_wa
print(0.5*(wa+k))
import numpy as np
n,k = map(int,input().split())

p = np.array(input().split(),np.int)


fs = p[:k]
f = sum(fs)
m = n - k + 1
qs = np.zeros(m)
qs[0] = f
if n == k:
    ans = (f + k)/2
    print(ans)
else:
    for i in range(k,n):
        a = qs[i-k] - p[i-k] + p[i]
        qs[i-k+1] = a
    ans = (max(qs)+k) / 2
    print(ans)
import numpy as np
N, K = map(int, input().split())
P = np.array(input().split(), dtype=int)
# 期待値に変換
Q = P/2 + 0.5
# 累積和をとる
S = Q.cumsum()
# K範囲での最大値
if N == K:
    print(S[-1])
else:
	T = S[K:] - S[:-K]
	print(max(T))
n,k=map(int,input().split())
pl=list(map(int,input().split()))

cuml=[]
cum=0
for i in range(n):
    cum+=(pl[i]+1)/2
    cuml.append(cum)
mx=0
for i in range(n-(k-1)):
    if i==0:
        mx=max(cuml[i+k-1],mx)
    else:
        mx=max(cuml[i+k-1]-cuml[i-1],mx)
print('{:.9f}'.format(mx))
N, K = map(int, input().split())
P = list(map(int, input().split()))
S =[0] * (N - K + 1)
S[0] = sum(P[0:K])

for i in range(1, N - K + 1):
    S[i] = S[i-1] - P[i-1] + P[i+K-1]

print((max(S) + K) / 2)
n,k=map(int,input().split())
p=[int(i)+1 for i in input().split()]

num=sum(p[:k])
tot=[num]
t_append=tot.append
for i in range(n-k):
  tmp=p[i+k]-p[i]
  num+=tmp
  t_append(num)
#print(tot)
print(max(tot)/2)
a, b = map(int, input().split())
c = list(map(int,input().split()))

x = [(e + 1) / 2 for e in c]

t = sum(x[0:b])
res = t
for i in range(a - b):
  t -= x[i]
  t += x[i+b]
  res = max(res,t)

print('{:.12f}'.format(res))
import numpy

n,k = map(int,input().split())
li = [(int(x)*(int(x)+1))/(2*int(x)) for x in input().split()]
a = numpy.cumsum(li)
ans = 0
for i in range(n-k+1):
    if i == 0:
        ans = a[i+k-1]
    else:
        if ans < (a[i+k-1] - a[i-1]):
            ans = a[i+k-1] - a[i-1]
print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = [(sum(p[:k])+k)/2]
for i in range(n-k):
    ans.append(ans[-1]+p[i+k]/2-p[i]/2)
print(max(ans))
N, K = map(int, input().split())
p = list(map(int, input().split()))

p.insert(0, 0)
for i in range(1, N+1):
    p[i] = (p[i] + 1) / 2 + p[i-1]

s = [0] * (N+1)
for i in range(N-K+1):
    s[i] = p[i+K] - p[i]

print(max(s))
def main():

    n, k = map(int, input().split())
    P = list(map(int, input().split()))
    # print(exp_sum(n, k, P))
    mx = 0
    for i in range(k):
        mx += (P[i] + 1) / 2
    tmp = mx
    for i in range(k, n):
        tmp += (P[i] - P[i - k]) / 2
        mx = max(mx, tmp)
    print(mx)

if __name__ == "__main__":
    main()
import numpy as np

N, K = map(int, input().split())
P = list(map(int, input().split()))

# N, K = 10, 4
# P = [17, 13, 13, 12, 15, 20, 10, 13, 17, 11]

exp = []
for i in range(N):
    exp.append((1 + P[i]) / 2)

cum_exp = np.cumsum(exp)

max = cum_exp[K-1]
for i in list(range(K, N)):
    val = cum_exp[i] - cum_exp[i - K]
    if val > max:
        max = val

print(max)
from collections import deque
import copy
N,K = map(int, input().split())
p = list([(i+1)* i/2/i for i in map(int, input().split())])
que = deque([0]* K)
sumM = 0
sumq = 0
E = 0.0

for i in range(N):
    sumq -= que.popleft()
    sumq += p[i]
    que.append(p[i])
    if E < sumq:
        E = sumq
print(E)
n, k = map(int, input().split())


def modify(x):
    return int(x) + 1


l = list(map(modify, input().split()))

s = sum(l[:k])
m = s
for i in range(k, n):
    s += l[i]
    s -= l[i-k]
    m = max(s, m)

print(m/2)
N,K = map(int,input().split())
p = list(map(int,input().split()))
from itertools import accumulate
pac = [0]+list(accumulate(p))
num = 0
for i in range(N-K+1):
    num = max(pac[i+K]-pac[i],num)
print((K+num)/2)
N,K=map(int,input().split())
p=list(map(int,input().split()))
ans=(sum(p[0:K])+K)/2
temp=ans
for i in range(1,N-K+1):
    temp-=(p[i-1]+1)/2
    temp+=(p[i+K-1]+1)/2
    if temp>ans:
        ans=temp
print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

hoge=0
for i in range(K):
    hoge += A[i]

re=hoge
for i in range(N-K):
    hoge=hoge+A[K+i]-A[i]
    if hoge >= re:
        re=hoge
        
print((re+K)/2)
from itertools import accumulate
from decimal import Decimal
n,k=map(int,input().split())
p=list(map(int,input().split()))
l=[0]
tmp=0
for i in range(n):
    p[i]=Decimal((p[i]+1)/2)
    tmp+=p[i]
    l.append(tmp)
ans=0
for i in range(k,n+1):
    tmp=l[i]-l[i-k]
    if tmp>ans:
        ans=tmp
print(Decimal(ans))
N,K = map(int, input().split())
P = [int(i) for i in input().split()]
total, maxS = 0, 0
S = [0]
for p in P:
    total += p*(p+1)/2/p
    S.append(total)

for i in range(N-K+1):
    if maxS < S[i+K]-S[i]:
        maxS = S[i+K]-S[i]
print(maxS)
n,k= map(int,input().split())
p= list(map(int,input().split()))
sp=[0]*(n-(k-1))
sp[0]=sum(p[0:k])
for i in range(1,n-(k-1)):sp[i]=sp[i-1]+p[i+k-1]-p[i-1]
print((max(sp)+k)/2)
n,k=map(int,input().split())
p=[0]+list(map(int,input().split()))
m=-1
s=0
s+=sum(p[0:k])
for i in range(len(p)-k):
    s+=p[i+k]
    s-=p[i]
    if m < s:
        m=s
print((m+k)/2)
N, K = map(int,input().split())
num = list(map(int, input().split())) 
p = list(map(lambda x: (x+1)/2, num))
    
ans = sum(p[0:K])
temp = ans
for i in range(N-K):
    temp = temp-p[i]+p[i+K]
    ans = max(ans, temp)
print(ans)
import numpy as np

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

e = (p + 1) / 2

# print(e)

cum_e = np.zeros(N + 1)
cum_e[1:] = np.cumsum(e)

# print(cum_e)

s = cum_e[K:] - cum_e[:-K]

print(max(s))
N, K = list(map(int,input().split()))
p = list(map(int,input().split()))

a = []
#各サイコロの期待値のリストaを作成
for i in range(N):
  a.append((p[i]+1)/2)
#累積和のリストSの作成
S = [0]
for i in range(N):
  S.append(S[i]+a[i])
#隣接N個のサイコロの期待値の和のリストansの作成
ans = []
for i in range(N-K+1):
  ans.append(S[i+K]-S[i])
  
print(max(ans))