We have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.
We will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.

-----Constraints-----
 - 1 ≤ K ≤ N ≤ 200000
 - 1 ≤ p_i ≤ 1000
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N K
p_1 ... p_N

-----Output-----
Print the maximum possible value of the expected value of the sum of the numbers shown.
Your output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.

-----Sample Input-----
5 3
1 2 2 4 5

-----Sample Output-----
7.000000000000

When we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.

Difficulty: interview

Starter code:

Solutions:
n,k = map(int, input().split())
P = list(map(int, input().split()))
e = []
for i in P:
    e.append((i+1)/2)
cumsum = [0]*(n+1)
for i in range(1,n+1):
    cumsum[i] = cumsum[i-1]+e[i-1]
k_sum = cumsum.copy()
for i in range(n+1):
    if i>=k:
        k_sum[i] -= cumsum[i-k]
print(max(k_sum[k-1:]))

import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    n, k = list(map(int, input().split()))
    p = np.array(read().split(), np.int32)
    p += 1
    pcum = np.zeros(n + 1, np.int32)
    pcum[1:] = p.cumsum()
    sum_k = pcum[k:] - pcum[:-k]
    print((sum_k.max()/2))

def __starting_point():
    main()

__starting_point()

N,K = map(int,input().split())
P = list(map(int,input().split()))
T = [0]*N

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

if N == K:
    print(sum(P))

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

    for i in range(K,N):
        T[i] = P[i] - P[i-K]

    T = T[K:]

    print(max(T))

def dice_expectation(p):
  return ((1 + p) * p / 2) * (1/p)

n, k = list(map(int, input().split()))
pp = [0] * (n+1)
for i, p in enumerate(map(int, input().split())):
  pp[i+1] = pp[i] + dice_expectation(p)

max = -1
for i in range(k, n+1, 1):
  max = pp[i] - pp[i-k] if pp[i] - pp[i-k] > max else max

print(max)


n, k = map(int, input().split())
p = list(map(int, input().split()))
total = sum([((p[i]*(p[i]+1))//2)/p[i] for i in range(k)])
ans = total
for i in range(k, n):
    pre = ((p[i-k]*(p[i-k]+1))//2)/p[i-k]
    nxt = ((p[i]*(p[i]+1))//2)/p[i]

    ans = max(ans, total-pre+nxt)
    total = total-pre+nxt
print(ans)

# -*- coding: utf-8 -*-
"""
Created on Mon Sep  7 22:29:36 2020

@author: liang
"""
N, K = map(int, input().split())

P = [1 + (int(p)-1)*0.5 for p in input().split()]
#print(P)

tmp = sum(P[:K])
ans = tmp
for i in range(N-K):
    tmp += P[K+i] - P[i]
    if tmp > ans:
        ans = tmp
    
print(ans)

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

nk = input().split()
N = int(nk[0])
K = int(nk[1])
p = input().split()

tmp = 0
for i in range (K):
    tmp += expect(int(p[i]))

tmpMax = tmp

for i in range(N - K):
    tmp -= expect(int(p[i]))
    tmp += expect(int(p[i+K]))
    tmpMax = max(tmpMax, tmp)

print(tmpMax)



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

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

Q=[(i+1)/2 for i in P]

p=ans=sum(Q[:K])

for i in range(N-K):
    p=p-Q[i]+Q[i+K]
    # print(i, ans, t,i+K,Q[i],Q[i+K])
    ans=max(ans, p)
print(ans)

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

E = []

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

tnt = sum(E[:K])
ans = tnt

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

print(ans)


def f(x):
    x = int(x)
    return x*(x+1)//2/x

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

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

print(a)


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

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

S = sum(I[:K])
ans = S
l = 0
r = K
while r < N:
    S = S - I[l] + I[r]
    ans = max(ans, S)
    l += 1
    r += 1

print(ans)
return




from itertools import accumulate
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

P = [((x+1) * x / 2) / x for x in P]
A = list(accumulate(P))

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

print(ans)


n,k = map(int,input().split())
s = list(map(int,input().split()))
num =0
w =[]
w = [1+0.5*(i-1) for i in s]
cnt =sum(w[:k])
ans = cnt
for i in range(n-k):
    cnt -= w[i]
    cnt += w[i+k]
    if cnt > ans:
        ans = cnt
print(ans)

from collections import deque
n, k = list(map(int, input().split()))
p = list(map(int,input().split()))

kitai = [0]*1000
tmp = 0
for i in range(1000):
  tmp += i+1
  kitai[i] = tmp/(i+1)
#print(kitai)

total_kitai = [0]*(n+1)
tmp = 0
for i in range(n):
  tmp += kitai[p[i]-1]
  total_kitai[i+1] = tmp
#print(total_kitai)

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


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

# max_list = []
# max_sum = 0

# for i in range(N - K + 1):
# 	if sum(p[i:i + K]) >= max_sum:
# 		max_sum = sum(p[i:i+K])
# 		max_list = p[i:i + K]
# ans = 0
# for n in max_list:
# 	ans += (n + 1) / 2

# print(ans)
expected = [0] * N
for i in range(N):
	expected[i] = (p[i] + 1) / 2

ans = 0
agg = 0
for i in range(N):
	if i < K:
		agg += expected[i]
	else:
		agg += expected[i]
		agg -= expected[i - K]
	ans = max(ans, agg)
print(ans)

def resolve():
    n,k = map(int,input().split())
    p = tuple(map(int,input().split()))
    s = [(i+1)/2 for i in p]
    a = sum(s[:k])
    ans = a
    for i in range(1,n-k+1):
        a = a - s[i-1] + s[k+i-1]
        ans = max(ans,a)
    print(ans)
resolve()

def e(n):
  return (int(n) + 1) / 2
n,k = map(int,input().split())
p = list(map(e,input().split()))
ans = sum(p[0:k])
temp = sum(p[0:k])
for i in range(1,n-k+1):
  temp += p[i+k-1] - p[i-1]
  ans = max(ans,temp)
print(ans)

import numpy as np

N,K=map(int,input().split())
p=list(map(lambda x:(int(x)+1)/2,input().split()))

if N==K:
    print(sum(p))
else:
    cs=np.cumsum(p)
    m=[]
    for i in range(N-K):
        m.append(cs[K+i]-cs[i])

    print(max(m))

N, K = map(int, input().split())
P = list(map(int, input().split()))
P = [(1+p)/2 for p in P]
L = [0]*(N+1)
for i in range(N):
  L[i+1] = L[i]+P[i]
print(max(L[i+K]-L[i] for i in range(N-K+1)))

# coding: utf-8


def main():
    N, K = list(map(int, input().split()))
    tmp, ans = 0.0, 0.0
    P = list(map(int, input().split()))

    for i in range(N):
        if i < K:
            tmp += P[i]
            ans = tmp
        else:
            tmp += P[i] - P[i - K]
            ans = max(ans, tmp)
    
    ans = (ans + K) / 2

    print(ans)


def __starting_point():
    main()

__starting_point()

N, K = map(int, input().split())
p = list(map(int, input().split()))
 
I = [0] * N
for i in range(N):
    I[i] = (p[i] + 1) / 2
 
S = sum(I[:K])
ans = S
l = 0
r = K
while r < N:
    S = S - I[l] + I[r]
    ans = max(ans, S)
    l += 1
    r += 1
 
print(ans)
return

N, K = [int(s) for s in input().split(' ')]
P = [int(s) for s in input().split(' ')]
s = []
a = sum(P[0:K])
s.append(a)
for p0, p1 in zip(P, P[K:]):
    a = a - p0 + p1
    s.append(a)

print(((max(s) + K) / 2))


N,K = map(int,input().split())
P = list(map(int,input().split()))
ls = [0] * (N + 1)

for i in range(N):
  ls[i+1] += ls[i] + (P[i] + 1) / 2
  
ans = 0
for j in range(N-K+1):
  tmp = ls[K+j] - ls[j]
  ans = max(ans, tmp)
  
print(ans)

def rsum(n):return (n+1)*(n//2)+((n+1)//2) if n%2 else (n+1)*(n//2)
N,K=map(int,input().split())
p=list(map(int,input().split()))
l=[0]*N
for i in range(N):l[i]=rsum(p[i])*(1/p[i])
s=sum(l[0:K])
ans=0
for i in range(N-K):
    ans=max(ans,s)
    s-=l[i]
    s+=l[i+K]
print(max(ans,s))

N, K = [int(n) for n in input().split()]
A = [int(n) for n in input().split()]
E = [0] * N

Elist = {}
for val in set(A):
    e = 0
    for i in range(1, val + 1):
        e += i / val
    Elist[val] = e

for i in range(N):
    E[i] = Elist[A[i]]

#print(E)

En = sum(E[:K])
Emax = En
for j in range(1, N-K+1):
    En = En - E[j-1] + E[j-1+K]
    Emax = max(Emax, En)

print(Emax) 


from itertools import accumulate
n, k = list(map(int, input().split()))
Pcum = [0]+list(accumulate(list(map(int, input().split()))))

ans = 0
for L in range(n):
    R = L+k
    if n < R:
        break
    cnt = (Pcum[R]-Pcum[L]+k)/2
    if ans < cnt:
        ans = cnt
print(ans)


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())
p = list(map(int, input().split()))
q = [0]
m = 0
for i in p:
    m += (1+i)/2
    q.append(m)
ans = 0
for i in range(k, n+1):
    ans = max(q[i]-q[i-k], ans)

#あまり深く事を考えずに
print(ans)

def main():
    n, k = map(int, input().split())
    p_lst = list(map(int, input().split()))
    lst = []

    for i in range(n):
        lst.append((p_lst[i] + 1) / 2)

    tmp_sum = sum(lst[:k])
    maximum = tmp_sum
    for i in range(n - k):
        tmp_sum -= lst[i]
        tmp_sum += lst[i + k]
        maximum = max(maximum, tmp_sum)

    print(maximum)


def __starting_point():
    main()
__starting_point()

n,k = map(int,input().split())
lst = list(map(int,input().split()))
E = [0]
for x in lst:
  E.append((1+x)/2+E[-1])
s = 0
for i in range(n+1-k):
  if s < E[i+k] - E[i]:
    s = E[i+k] - E[i]
print(s)    

n, k = map(int,input().split())
p = list(map(int,input().split()))
mu = [(a+1)/2 for a in p]
maxsum = sum(mu[:k])
now = maxsum
left = 0
right = k
while right<n:
    now = now+mu[right]-mu[left]
    if maxsum<now:
        maxsum = now
    left += 1
    right += 1
print(maxsum)

from numpy import *
N,K = map(int,input().split())
P = list(map(int,input().split()))
Q = (N-K+1)*[0]
R = sum(P[0:K])
Q[0] = R

for n in range(1,N-K+1):
  R+=P[n-1+K]-P[n-1]
  Q[n] = R

S = argmax(Q)
print(0.5*(sum(P[S:S+K])+K))

import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
mod = 10**9 + 7
sigma = lambda x : x*(x+1)//2

#--maincode----------------

n,k = inm()
p = inl()
s = sum(p[:k])
c = s
d = 0
for i in range(k,n):
    s = s - p[i-k] + p[i]
    if c < s:
        c = s
        d = i-k+1
ans = sum(sigma(x)/x for x in p[d:d+k])
print(ans)

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

Q=[0]*(N+1)
for n in range(N):
  Q[n+1]=Q[n]+P[n]

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

print(ans)

N, K = map(int, input().split())
p = list(map(int, input().split()))
  
# 「和の期待値」は「期待値の和」なので、先に期待値を求める
for i in range(N):
  p[i] = (1+p[i])/2

# 累積和
S = [0]*N
S[0] = p[0]
for i in range(N-1):
  S[i+1] = S[i] + p[i+1]

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

print(ans)

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

#期待値 : (p+1)//2
range_total = sum(P[:K]) + K
max_value = range_total
for i in range(N-K):
    range_total += P[K+i] - P[i]
    max_value = max(max_value, range_total)
print(max_value / 2)

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

for i in range(n):
  l[i]=(l[i]+1)/2

lis=[0]*(n+1)
for i in range(n):
  lis[i+1]=lis[i]+l[i]
  
ans=0
for i in range(n-k+1):
  num=lis[i+k]-lis[i]
  ans=max(num,ans)
  
print(ans)

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


import sys
input = sys.stdin.readline # for speed up
#sys.setrecursionlimit(10**9)

n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*n
for ii in range(n):
    b[ii]=(1+a[ii])/2

temp=sum(b[0:k])
ans=temp
for ii in range(n-k):
  temp+=b[ii+k]-b[ii]
  if temp>ans:
    ans=temp

print(ans)

nk = input().split()
n = int(nk[0])
k = int(nk[1])
p_s = input().split()
p = [int(s) for s in p_s]
max_val = 0
for i in range(0,k):
    max_val+=p[i]
tmp = max_val
for i in range(k,len(p)):
    tmp = tmp - p[i-k] + p[i]
    if tmp > max_val:
        max_val=tmp
print(max_val/2 + 0.5 * k)

N, K = map(int, input().split())
P = list(map(int, input().split()))
P = [sum(P[:K])+K]+P
for i in range(N-K):
    P[i+1] = P[i]-P[i+1]+P[K+i+1]
print(max(P[:N-K+1])/2)

N, K = map(int, input().split())
p = list(map(int, input().split()))
for i in range(N):
    p[i] = p[i] / 2 + 0.5

s = 0
for i in range(K):
    s += p[i]
maxSum = s
j = 0

for i in range(K, N):
    s = s + p[i] - p[i-K]
    maxSum = max(maxSum, s)
print(maxSum)

# import itertools
# import math
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np

# N = int(input())
# S = input()
# n, *a = map(int, open(0))
N, K = map(int, input().split())
P = list(map(int, input().split()))
# B = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
# S = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)

E = [0]
tot = 0
for p in P:
    tot += (p + 1) / 2
    E.append(tot)


m = 0
for i in range(N - (K - 1)):
    _ = E[i + K] - E[i]
    if _ > m:
        m = _

print(m)

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

d_tmp = sum(p[0:k])
d_max = sum(p[0:k])
for i in range(n-k):
  d_tmp = d_tmp + p[k+i] - p[i]
  d_max = max(d_max,d_tmp)

ans = (d_max + k)/2
print(ans)

N,K=list(map(int,input().split()))
p=list(map(int,input().split()))
sum=0
v=[]
for i in range(K):
    sum+=p[i]
v.append(sum)
for i in range(K,N):
    sum+=p[i]
    sum-=p[i-K]
    v.append(sum)
M=0
for i in range(N+1-K):
    M=max(M,v[i])
print(((M+K)/2))


N,K = map(int,input().split())
p = list(map(lambda x: int(x)+1,input().split()))
ans = sum(p[0:K])
s = ans
for i in range(1,N-K+1):
    s += p[i+K-1]-p[i-1]
    ans = max(ans,s)
print(ans/2)

#import math
#import collections
n,k = map(int, input().split( ))
A = list(map(int, input().split( )))

arr = [0]*n
for i in range(n):
  arr[i] = (A[i]+1)/2

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

n,k=map(int,input().split())
data=list(map(float,input().split()))
new_data=[0]*n
for i in range(n):
    new_data[i]=(data[i]+1)/2
temp=0
for i in range(k):
    temp+=new_data[i]
ans=temp
for i in range(n-k):
    temp=temp-new_data[i]+new_data[i+k]
    ans=max(ans,temp)
print(ans)

n,k = map(int,input().split())
p = list(map(int,input().split()))
q = [0]*n
for i in range(n):
  q[i] = (1+p[i])/2
s = [0]*(n+1)
for j in range(n):
  s[j+1]=s[j]+q[j]
t = k+1
answer = s[k]-s[0]
while(t<=n):
  answer = max(answer,s[t]-s[t-k])
  t +=1
print(answer)

N, K = list(map(int, input().split()))
P = [(int(x)+1)/2 for x in input().split()]

total=ans=sum(P[:K])
for n in range(K,N):
  total+=P[n]-P[n-K]
  ans=max(ans, total)

print(ans)


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

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

n = sum(lst[:K])
m = n

for i in range(N - K):
    l = lst[i]
    r = lst[i + K]
    n = n + r - l

    if m < n:
        m = n

ans = (m + K)/2
print(ans)


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

def ev(n):
    return n * (n + 1) / (2 * n)

q = [0]
for i in range(n):
    q.append(ev(p[i]))
    q[i + 1] = q[i] + ev(p[i])
#print(q)

tmp = 0
for j in range(n - k + 1):
    if tmp <= q[j + k] - q[j]:
        tmp = q[j + k] - q[j]
print(tmp)


n,k = map(int, input().split())
p = list(map(lambda x: (int(x)+1)/2, input().split()))

t = sum(p[:k])
ans = t
for i in range(k,n):
  t += p[i] - p[i-k]
  if ans < t: ans = t
print(ans)

from itertools import accumulate
n, k = list(map(int, input().split()))
Pcum = [0]+list(accumulate([int(x)+1 for x in input().split()]))

ans = 0
for L in range(n):
    R = L+k
    if n < R:
        break
    cnt = (Pcum[R]-Pcum[L])/2
    if ans < cnt:
        ans = cnt
print(ans)


def main():
	N, K = [int(x) for x in input().split(" ")]
	P = [int(p) for p in input().split(" ")]
	E = [sum(P[:K])]
	for i in range(N - K):
		E.append(E[-1] - P[i] + P[i + K])
	print((max(E) + K)/2)

main()

N,K=list(map(int,input().split()))
p=list(map(int,input().split()))
s=0
hoge=0
ans=0
for i in range(K):
    s+=p[i]
    temp=s
for j in range(N-K):
    s=s-p[j]+p[j+K]
    if temp<s:
        temp=s
        hoge=j+1

for k in range(K):
    ans+=(1+p[hoge+k])/2

print(ans)


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


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

total=sum(a[i] for i in range(k))
ans=total

for i in range(0,n-k):
    total=total-a[i]+a[i+k]
    if total>ans:
        ans=total
print(ans)

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

p_list_E = []
p_list_E_temp = [1, 1.5, 2, 2.5, 3, 3.5]

for i in range(len(p_list)):
    p_list_E.append((p_list[i]+1)*0.5)
#print(p_list_E)

p_list_sum = [0]
for i in range(0,N):
    p_list_sum.append(p_list_sum[i]+p_list_E[i])
#print(p_list_sum)

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

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

for i in range(n):
    e.append(p[i] + 1)

sum_e = [0]

for i in range(1,n+1):
    sum_e.append(sum_e[i-1]+e[i-1])

ans = []

for i in range(n-k+1):
    ans.append(sum_e[i+k]-sum_e[i])

print(max(ans)/2)


def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a)

def __starting_point():
    main()
__starting_point()

raw = input().split(" ")
n = int(raw[0])
k = int(raw[1])
pref = []
raw = input().split(" ")
for i in range(n):
    elem = float(raw[i])
    if(len(pref) == 0):
        pref.append((elem + 1)/2)
    else:
        pref.append(pref[-1] + (elem + 1)/2)

best = 0
idx = k - 1
while(idx < n):
    if(idx == k - 1):
        best = pref[idx]
    else:
        best = max(best, pref[idx] - pref[idx - k])
    idx += 1

print(best)

N,K=map(int,input().split())
p=list(map(int,input().split()))
l=[sum(p[:K])]
for i in range(1,N-K+1):
  l.append(l[-1]-p[i-1]+p[i+K-1])
print((max(l)+K)/2)

import sys

N,K=list(map(int,input().split()))
P=list(map(int,input().split()))
Q=[(1+p)/2 for p in P]
temp=sum(Q[:K])
ans=temp
for i in range(N):
  try:
    temp=temp-Q[i]+Q[i+K]
    ans=max(ans,temp)
  except:
    pass
else:
  print(ans)


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

ans=0
sum_num=sum(p[:k])
for i in range(n-k+1):
    if i==0:
        sum_num = sum(p[:k])
    else:
        sum_num+=p[i+k-1]-p[i-1]
    ans=max(ans,sum_num)
print(ans)

#!/usr/bin/env python3
def main():
    import numpy as np

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

    P[:] += 1
    Pcum = np.zeros(N + 1, np.int32)
    Pcum[1:] = np.cumsum(P)
    length_K_sums = Pcum[K:] - Pcum[:-K]
    print((length_K_sums.max() / 2))


def __starting_point():
    main()

__starting_point()

N, K = map(int, input().split())
p = list(map(int, input().split()))
  
# 「和の期待値」は「期待値の和」なので、期待値を求めておく
for i in range(N):
  p[i] = (1+p[i])/2

# すると結局[(p_1+1)/2,...,(p_N+1)/2]の配列から、隣接するK個の和の最大値を求めればよい
# N=10^5なので、O(N)で解く
# 2重ループは間に合わない・・・累積和！
# 累積和によって、配列上の区間の総和を求める処理を高速化！
S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + p[i]
'''
S[0] = 0
S[1] = p[0]
S[2] = p[0] + p[1]
S[N] = p[0] + ... + p[N-1]

S[K]-S[0] = p[K-1] + ... + p[0]
S[K+1]-S[1] = p[K] + ... + p[1]
S[K+2]-S[2] = p[K+1] + ... + p[2]
S[N]-S[N-K] = p[N-1] + ... + p[N-K]
'''

ans = 0
# max(S[K]-S[0],S[K+1]-S[1],...,S[N]-S[N-K]) を求める
for i in range(N-K+1):
  ans = max(ans, S[i+K] - S[i])
  
print(ans)

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

a = sum(p[:K])
s = sum(p[:K])
for i in range(K, N):
    s += p[i] - p[i - K]
    a = max(a, s)

ans = (a + K) / 2
print(ans)

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

# 「和の期待値」は「期待値の和」なので、期待値を求めておく
for i in range(N):
  p[i] = (1+p[i])/2

# すると結局[(p_1+1)/2,...,(p_N+1)/2]の配列から、隣接するK個の和の最大値を求めればよい
# N=10^5なので、O(N)で解く
# 2重ループはO(NK)で間に合わない
# 累積和を用いるとO(N)で解ける！（累積和とは、配列上の区間の総和を求める処理を高速化する手法）
S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + p[i]
'''
S[0] = 0
S[1] = p[0]
S[2] = p[0] + p[1]
S[N] = p[0] + ... + p[N-1]
 
S[K]-S[0] = p[K-1] + ... + p[0]
S[K+1]-S[1] = p[K] + ... + p[1]
S[K+2]-S[2] = p[K+1] + ... + p[2]
S[N]-S[N-K] = p[N-1] + ... + p[N-K]
'''
 
ans = 0 # ans = max(S[K]-S[0],S[K+1]-S[1],...,S[N]-S[N-K])
for i in range(N-K+1):
  ans = max(ans, S[i+K] - S[i])
  
print(ans)

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

for i in range(n):
    p[i] = (1+p[i]) / 2
    
res = sum(p[:k])
ans = res
    
for i in range(n-k):
    res += -p[i] + p[i+k]
    ans = max(ans,res)
    
print(ans)

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

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

ruisekiwa = [0]

for P in Ps:
    ruisekiwa.append(P + ruisekiwa[-1])

#print(ruisekiwa)
ans = 0
for i in range(N-K+1):
    ans = max(ans, (ruisekiwa[i+K] - ruisekiwa[i] + K) / 2)
#    print(ans)
print(ans)

n, k = map(int,input().split())
p = list(map(lambda x:int(x)+1,input().split()))

s = [0]*(n+1)

for i in range(n):
    s[i+1] = s[i] + p[i]
    
res = 0
for i in range(n-k+1):
    res = max(res,s[i+k]-s[i])
print(res/2)

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

sample = []
for i in range(1,1001) :
    sample.append((1+i)/2)

kitaichi = []
for i in range(n) :
    kitaichi.append(sample[p[i]-1])

maxkitaichi = 0
sum = 0
for i in range(k) :
    maxkitaichi += kitaichi[i]
    sum += kitaichi[i]

for i in range(1,n-k+1) :
    sum = sum + kitaichi[i+k-1] - kitaichi[i-1]
    if sum >= maxkitaichi :
        maxkitaichi = sum
        
print(maxkitaichi)


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

for i in range(N):
  p[i]=(1+p[i])/2
  
ans=[0]*(N-K+1)
ans[0]=sum(p[:K])
for i in range(1, N-K+1):
  ans[i]=ans[i-1]-p[i-1]+p[i+K-1]

print(max(ans))

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

a = [1+(i-1)/2 for i in p]
l = sum(a[:k])
ans = l
for i in range(1, n-k+1):
    l = l-a[i-1]+a[k+i-1]
    ans = max(ans, l)
print(ans)

N,K=map(int,input().split())
p=list(map(int,input().split()))
l=[sum(p[:K])]
#return
for i in range(1,N-K+1):
  l.append(l[-1]-p[i-1]+p[i+K-1])
#L=l.index(max(l))
#print(l)
print((max(l)+K)/2)

from functools import reduce
n, k = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
tmp_max = sum([i / 2 + 0.5 for i in p[0:k]])
tmp = tmp_max
idx = 0
for i in range(1, len(p) - k + 1):
	tmp -= p[i - 1] / 2 + 0.5
	if i + k - 1 < len(p):
		tmp += p[i + k - 1] / 2 + 0.5
	tmp_max = max(tmp_max, tmp)
print(tmp_max)

n, k = map(int, input().split())
p = list(map(int,input().split()))
q = [(x+1)/2 for x in p]
q1 = sum(q[:k])
ans = q1

for i in range(n-k):
  x = q1-q[i] +q[i+k]
  q1 = x
  if ans < x:
    ans = x
  
print(ans)

N,K = map(int,input().split())
P = list(map(int,input().split()))
Q = sum(P[:K])
R = Q

for n in range(N-K):
  Q = Q-P[n]+P[n+K]
  R = max(Q,R)

print((R+K)/2)

#!/usr/bin/env python3
def main():
    def expected_val(limit):
        return (1 + limit) / 2

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

    lst = [0]
    res = 0
    for p in P:
        # res += (p + 1) / 2
        res += expected_val(p)
        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)


def __starting_point():
    main()

__starting_point()

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

P[0] = (P[0]+1.)/2
for i in range(1,len(P)):
    P[i] = (P[i]+1.)/2
    P[i] = P[i-1]+P[i]

ans = 0.

if n==1:
    ans = P[0]

elif len(P)-k==0:
    ans = P[k-1]
else:
    for i in range(len(P)-k):
        ans = max(ans,(P[i+k]-P[i]))
        
    
print(ans)

N,K=map(int,input().split())
List = list(map(int, input().split()))
INF = 10000000000
expList = [INF]*1001
def expectationF(num):
  if expList[num] == INF:
    exp = 0
    for i in range(1,num+1):
      exp += i/num
    expList[num] = exp
  return expList[num]

res = 0
mid = 0
midList=[]
for i in range(N):
  if i>=1:
    midList.append(expectationF(List[i])+midList[i-1])
  else:
    midList.append(expectationF(List[i]))
m=K-1
for j in range(N-m):
  if j == 0:
    mid = midList[j+m]
  else:
    mid = midList[j+m]- midList[j-1] 
  res = max(res,mid)
print(res)

from itertools import accumulate
N, K = map(int, input().split())
P = list(map(int, input().split()))

A = list(accumulate(P))

largest = A[K-1]
point = 0
for i in range(K, N):
    if largest < A[i] - A[i-K]:
        largest = A[i] - A[i-K]
        point = i

ans = 0
for j in range(point - K + 1, point+1):
    p = P[j]
    ans += (((p + 1) * p) / 2) / p

print(ans)

N,K = map(int,input().split())
p = list(map(int,input().split()))
ans = sum(p[0:K])
s = ans
for i in range(1,N-K+1):
    s += p[i+K-1]-p[i-1]
    ans = max(ans,s)
print((K+ans)/2)

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

s = sum(p[:K])
ss = []
ss.append(s)

for i in range(N - K):
    s = s - p[i] + p[i+K]
    ss.append(s)

print(K + (max(ss) - K) / 2)

n, k = list(map(int, input().split(' ')))
aaa = list(map(int, input().split(' ')))
ans = 0
v = []
for a in aaa:
  v.append((a * (a + 1)) / (2.0 * a))

current = 0
for i in range(n):
  current += v[i]
  if i >= k:
    current -= v[i-k]
  ans = max(ans, current)
print(ans)

import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
import math
import itertools
#import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
mod = 998244353

'''
1 3 3 10 15
1 1.5 1.5 2.5 3 
'''

n, k = rl()
p = rl()
sum_=0
cum, ans, ser = [],[],[]
for i in range(1,2000):
    sum_+=i
    cum.append(sum_/i)
for i in p:
    ans.append(cum[i-1])
cs = [0]
for i in range(n):
    cs.append(cs[i]+ans[i])
for i in range(n+1-k):
    ser.append(cs[i+k]-cs[i])
print((max(ser)))
    


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

s = 0
acsum = [0]
for x in p:
    s += (x + 1)/2
    acsum.append(s)

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

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

# 累積和 
s = [0] * (N+1)
for i in range(N):# O(N)
    s[i+1] = s[i] + P[i]

# [j,j+K) の和の最大値と j を保持 
m = 0
midx = 0
for j in range(N-K+1):# O(N)
    v = s[j+K] - s[j]
    if v > m:
        m = v
        midx = j
        
E = 0
for k in range(midx,midx+K):# O(K)
    x = P[k]
    E += (1/x)*(x*(x+1)/2)
print(E)




inp  = input().split(' ')
n = int(inp[0])
k = int(inp[1])

nums = input().split(' ')
nums = [int(x) for x in nums]
sums = [0]
for x in nums:
  sums += [x + sums[-1]]

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







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

Q=[(i+1)/2 for i in P]
p=R=sum(Q[:K])

for i in range(N-K):
 p=p-Q[i]+Q[i+K]
 R=max(R, p)
print(R)

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

# Piの期待値 (1 + Pi) // 2
E = list(map(lambda x: (x + 1) / 2, P))
E_SUMS = [E[0]]
for i in range(1, N):
    E_SUMS.append(E_SUMS[i - 1] + E[i])

m = E_SUMS[K - 1]
for i in range(K, N):
    m = max(m, E_SUMS[i] - E_SUMS[i - K])

print(m)

import os, sys, re, math


def get_exp_value(number):
    if number == 0:
        return 0
    a = (number + 1) / number
    exp = a * (number // 2)
    if number % 2 != 0:
        exp += a / 2

    return exp


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

exps = [get_exp_value(i) for i in range(200001)]

s = sum(P[0:K])
max_sum = 0
max_pos = 0
for i in range(K, N):
    s = s - P[i - K] + P[i]
    if s > max_sum:
        max_sum = s
        max_pos = i

answer = 0
for i in range(max_pos - K, max_pos):
    answer += exps[P[i + 1]]

print(answer)


N, K = map(int, input().split())
P = list(map(int, input().split()))
ans = 0
for i in range(K):
    ans += (P[i]+1)/2

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

print(ans)

n, k = map(int, input().split())
p = [(int(i) + 1) / 2 for i in input().split()]
res = [sum(p[:k])]
for i in range(n-k): res.append(res[i] - p[i] + p[i+k])
print(max(res))

N, K = list(map(int, input().split()))
A = list([int(s)+1 for s in input().split()])
ans = sum(A[0:K])
tmp = ans
#print(A)
for i in range(N-K):
  tmp += (A[i+K]-A[i])
  ans = max(ans, tmp)
print((ans/2))


def main():

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

    ex = [0]
    for x in p:
        ex.append(ex[-1] + (x+1)/2)

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

    print(ans)

main()

import copy
n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
U = [0]*n

for i in range(n):
    U[i] = (P[i]+1)/2

ans = sum(U[:k])
t = copy.copy(ans)

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