peterverebics/CodeNet_Python_118 huggingface dataset:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 04:56:52 2020

@author: Kanaru Sato
"""

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

sum = 0
sumlist = [0]
for i in range(n):
    sum += p[i]
    sumlist.append(sum)

print(sumlist)

Max = -100000
for i in range(n-k):
    e = sumlist[i+k]-sumlist[i]
    if Max < e:
        Max = e

print((Max+k)/2)
n,k = map(int,input().split())
p = list(map(int,input().split()))
m=[0,0,0];
for i in range(n-k+1):
    s=p[i:i+k]
    if(m<s):m=s
a=0;
for j in range(k):
    a += sum(range(m[j]+1))/m[j]
print(a)
n, k = map(int, input().split())
p = [int(i) for i in input().split()]
total = [0] * n
total[0] = sum(range(1, p[0] + 1)) / p[0]
max_value = 0
for i in range(1, n):
    total[i] = total[i - 1] + sum(range(1, p[i] + 1)) / p[i]
    if i == k - 1:
        max_value = total[i]
    elif i >= k:
        max_value = max(max_value, total[i] - total[i - k])
print(max_value)
N, K = map(int, input().split())
P = list(map(int, input().split()))

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

tmp = 0
for i in range(K):
    tmp += P[i]
ans = P[i]

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

print (ans)
from itertools import accumulate
N,K = map(int,input().split())
P = list(map(int,input().split()))
ans = 0
hope = []
for i in range(N):
  hope.append((P[i]+1)/2)
hope = list(accumulate(hope))

for j in range(N-K):
  ans = max(ans,hope[j+K]-hope[j])
print(ans)
N,K=input().split()
n,k=int(N),int(K)
p=list(input().split())

for i in range (len(p)):
    p[i]=int(p[i])
    

maxs=0


def f(m,p):
    q=0
    for i in range (m):
        q=q+p[i]
    return q
    

for i in range (n-k):
    a=f(i+k,p)-f(i,p)
    if a>=maxs:
        maxs=a
print (maxs)
print((maxs+k)/2)
N,K=map(int,input().split())
p=list(map(int,input().split()))
a=0
for j in range(K):
    a+=(1+p[j])/2
Max=a
for i in range(K-1,N):
    a=a+(p[i]-p[i-K+1])/2
    if Max<a:
        Max=a
print(Max)
N, K = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]

a = [p[0]]
for i in range(1,N):
    a += [a[i-1] + p[i]]

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

print("{0:.12f}".format((ans + K )/2))
from sys import stdin
N, K = [int(x) for x in stdin.readline().rstrip().split()]
P = [(int(x)+1)/2 for x in stdin.readline().rstrip().split()]
l = 0
r = len(P)
m = 0
res = []
res.append(P[0])
for i in range(len(P)-1):
    res.append(res[i] + P[i+1])

while(K < r):
    kitai = res[K] - res[l]
    if (kitai > m):
        m = kitai
    l +=1
    K +=1

print(m)
N, K = map(int, input().split())
A = list(map(int, input().split()))

window = sum(A[0:K])
max_s = 0
for i in range(N - K):
    window -= A[i]
    window += A[i + K]
    if window > max_s:
        max_s = window
print((max_s+K) / 2)
def calc(A):
    res = 0
    res = (1+A)/2
    return res
    
N, K = map(int, input().split())
P = list(map(int, input().split()))
P.sort(reverse=True)
Q = P[:K]
res = 0
for q in Q:
    res += calc(q)
print(res)
n,k=map(int,input().split())
l=list(map(int,input().split()))

d={}

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

#print(d)

dp=[]
dp.append(d[l[0]])
for i in range(1,n):
  dp.append(dp[i-1]+d[l[i]])

#print("this is dp",dp)

mx=0
for i in range(n-k):
  we=dp[i+k]-dp[i]
  if we>=mx:
    mx=we
print("{:.6f}".format(mx))
n,k=map(int,input().split())
p=list(map(int,input().split()))
maxk=0
for i in range(k,n):
  count=0
  for j in range(k):
    count+=p[i-j]
  maxk=max(maxk,count)
maxk=(maxk + k)/2
print(maxk)
N, K = map(int, input().split())
ilist = list(map(int,input().split()))
max_dice = sum(ilist[:K])
ind = 0
i = 0
if N == K:
    print(sum(ilist))
else:
    while True:
        s = max_dice - ilist[i] + ilist[i+K]
        if s > max_dice:
            max_dice = s
            ind = i + 1
        if i == N-K-1:
            break
        else:
            i += 1
    max_p = (sum(ilist[ind:ind+K])+K)/2
    print(max_p)
n, k = map(int, input().split())
p = list(map(int, input().split()))

l = 0
r = k
ansl = 0
ansr = 0
ans = 0
tmp = sum(p[:k])
# print(tmp)
for i in range(1,n - k+1):
    tmp = tmp - p[i-1] + p[i + k-1]
    # print(i,i+k-1,tmp)
    if tmp > ans:
        ansl = i
        ansr = i + k - 1
        ans = tmp
# print(ansl, ansr)
ans2 = 0
for i in range(ansl, ansr + 1):
    ans2 += (p[i] + 1) / 2
print(ans2)
Input1 = [int(_) for _ in input().split(" ")]
Input2 = [(int(i)+1)/2 for i in input().split(" ")]

Max = sum(Input2[:Input1[1]])

for j in range(Input1[0]-Input1[1]):
    sum_ = Max-Input2[j]+Input2[j+Input1[1]]
    if Max  < sum_:
        Max = sum_
        
print(Max)
N, K = map(int, input().split())
L = list(map(int, input().split()))
E = [(v+1)/2 for v in L]
tmp = sum(E[:K])
ans = tmp
for l, p in zip(E[K:], E):
    tmp = tmp-l+p
    ans = max(ans, tmp)
print(ans)
def main():
  N, K = map(int, input().split())
  p = list(map(int, input().split()))
  
  l = sorted(p, reverse=True)   #降順
  #print(l)
  
  #for i in range(K, N):
  del l[K:]
  #print(l)
    
  ans = 0
    
  for i in l:
    ans += sum(range(1, i+1)) / i
    
  print(ans)
 
  
  
main()
n,k = map(int,input().split())
p = list(map(float,input().split()))

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

ans = [0 for i in range(n)]
ans[k-1] = sum(p[0:k])
for i in range(k,n-k+1) :
  ans[i] = ans[i-1] + p[i] - p[i-k]
  
print(max(ans))
n, k, *p_n = map(int, open(0).read().split())
p_n.insert(0, 0)
for i in range(n):
    p_n[i + 1] = ((p_n[i + 1] + 1) / 2) + p_n[i]
    
p_n.insert(0, 0)

exp_sum = [0] * (n - k + 1)
for i in range(n - k + 1):
    exp_sum[i] = p_n[i + k] - p_n[i]
    
print(max(exp_sum))
import numpy as np

n, k = map(int, input().split())
p = list(map(int, input().split()))
m = (np.array(p) + 1)/2
cum  = np.cumsum(m)

ma = 0
for i in range(n - k):
    a = cum[i + k] - cum[i]
    if ma < a:
        ma = a
print(ma)
import sys
sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, input().split(' ')))
def In(): return int(input())
def InS(): return input()

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

for i in range(len(p)):
    p[i] = (1+p[i]) / 2
    
max = 0

for i in range(k):
    max += p[i]
print(max)
tmp = max

for i in range(n-k):
    tmp = tmp - p[i] + p[i+k]
    if max < tmp: max = tmp
print(max)
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
ans = 0
for i in range(n):
    p_list[i] = (1 + p_list[i]) / 2

wa = sum(p_list[0:k])

for j in range(n-k):
    wa = wa + p_list[j+k] - p_list[j]
    ans = max(ans, wa)
    
print(ans)
n,k=map(int,input().split())
p_=input().split()
p=[]
for i in p_:
    p.append(int(i))
p.sort()
result=0
for i in range(k):
    result+=p[-i]/2
print(result)
N,K = map(int,input().split())
Pi = list(map(int,input().split()))

#print(Pi)
indMax = Pi.index(max(Pi))

MX = sum(Pi[indMax-1:indMax+K-1])
  
ans= (MX + K)/2
print(ans)
#n/2(n+1) / n = 1/2 (n+1)

#1/2 (n+1)
#KN + K
n, k, *p = map(int, open(0).read().split())

p = tuple(p)
max_r = 0
max_i = 0
pre = 0
for i in range(n-k+1):
  if pre > p[i+k-1]:
    continue
  r = sum(p[i:i+k])
  pre = p[i]
  
  if r > max_r:
    max_r = r
    max_i = i
    
max_e = 0
for j in range(max_i, max_i+k):
  max_e += (p[j]+1)/2

print(max_e)
import sys
n, k = map(int, sys.stdin.readline().rstrip().split())
pi = list(map(int, sys.stdin.readline().rstrip().split()))
pi.sort()
pi = pi[::-1]
res = 0
for i in range(k):
    if pi[i] == 1:
        res += 1
    if pi[i] % 2 == 0:
        res += pi[i] / 2 + 0.5
    else:
        res += pi[i] // 2 + 1
print(res)
from itertools import accumulate
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
P = [int(_) for _ in stdin.readline().rstrip().split()]
evs = [(1+p)/2 for p in P]
evs = [0] + list(accumulate(evs))
ans = 0
for i in range(1, N-K+1):
    ans = max(ans, evs[i+K]-evs[i])
print(ans)
import numpy as np
n,k=map(int,input().split())
p=list(map(int,input().split()))
ans=0
l=[]
for i in p:
  l.append(float((i+1)/2))
t=np.cumsum(np.array(l))
for j in range(n-k):
  ans=max(ans,t[j+k]-t[j])
print(ans)
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

a,b=map(int,input().split())
c=list(map(int,input().split()))

if a==b:
    print((sum(c)+a)/a)
    exit()
d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)
print(n)
m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))
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] - P[0]
else:
    for i in range(len(P)-k):
        ans = max(ans,(P[i+k]-P[i]))
        
    
print(ans)

# https://atcoder.
n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
tot = 0
for i in range(n):
    tot += P[i] * (P[i] + 1) / (2 * P[i])
    P[i] = tot
ans = 0
for i in range(n - k):
    ans = max(ans, P[i + k] - P[i])
print(ans)
from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().split()]
P = [int(x) for x in stdin.readline().rstrip().split()]

D = sum(P[:K])
index = 0

for i in range(1, N - K + 1):
    if D + P[i + K - 1] - P[i - 1] > D:
        D = D + P[i + K - 1] - P[i - 1]
        index = i

ans = (sum(P[index: index+K]) + K) / 2

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

a = [(1+p[i])/2 for i in range(n)]
res = sum(a[0:k])

for i in range(k,n):
    if a[i-k]<a[i]:
        res = sum(a[i-k+1:i+1])
        ans = a[i-k+1:i+1]

print(res)
from decimal import Decimal

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

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

l = 0
s = sum(e[:k-1])
for i in range(n-k):
    tmp = s + e[i+k] - e[i]
    if tmp > s:
        s = tmp
        l = i + 1

print(sum(e[l:l+k]))
N,K=list(map(int,input().split()))
p=list(map(int,input().split()))


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

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

print(tmp)
from itertools import accumulate
n, k = map(int, input().split())
p = list(map(int, input().split()))

pp = [0] + list(accumulate(p))

m = 0
for i in range(len(pp) - k):
  m = max(m,pp[i + k] - pp[i - 1])
print((m+k)/2)
# 初期入力
N,K = (int(x) for x in input().split(" "))
A = list(map(int, input().split()))

# 左からa番目のサイコロの期待値
kitaiti = []

# kitaiti.append ( sum([ j for j in range(1,i +1)] ) /i)
kitaiti =[ sum([ j for j in range(1,i +1)] ) /float(i)  for i in A ]

# 隣接するK個の期待値を足す
sum_K =[]
sum_K = [float( sum(kitaiti[i:K +i]) ) for i in range(K) ] 
sum_K_max = max(sum_K)
# print(kitaiti)
# print(sum_K)
print(sum_K_max)
n, k = map(int, input().split())
p = list(map(int, input().split()))

sekiwa = [p[0]]
for i in range(1, n):
    sekiwa.append(sekiwa[-1]+p[i])

saidai = 0
for i in range(n-k+1):
    if sekiwa[i+k-1] - sekiwa[i] >= saidai:
        saidai = sekiwa[i+k-1] - sekiwa[i]
        hajimari = i

ans = 0
for i in range(hajimari, hajimari+k):
    ans += (1+p[i])/2

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

dp = [0] * n
for i in range(n):
  dp[i] = p[i] / 2 + 0.5
  
m = sum(dp[0:k])
max = m
for i in range(1,n-k + 1):
  m = m - p[i-1] + p[i+k-2]
  if m > max:
    max = m
print(max)
n, k = map(int, input().split())
p = list(map(int, input().split()))
 
def S(n):
    return n * (n + 1) // 2
ans = 0 
for i in range(k):
    ans += S(p[i]) / p[i]
 
for i in range(k, n):
    ans = max(ans, ans + S(p[i]) / p[i] - S(p[i - k]) / p[i - k])
    
print(ans)
query=[int(x) for x in input().split()]
N = query[0]
K = query[1]
L = list()
L = [int(x) for x in input().split()]



def prob(x):
    out = 0.0
    for i in range(1, x + 1):
        out = out + (1 / x) * i

    return out


final = 0.0
answer=list()
for i in range(0, N):
    final=0.0
    for j in range(i, K+i):
        if K+i<N:
            div = L[j]
            final = final + prob(div)
    answer.append(final)

print("%14.12f"%max(answer))
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
kitai = []
for i in range(n):
    kitai.append((1+p[i])/2)
wa = []
a = 0
for i in range(n):
    a += kitai[i]
    wa.append(a)
ans = 0
for i in range(n-k):
    ans = max(ans, wa[i+k] - wa[i])

print(ans)
n, k = map(int, input().split())
ps = list(map(lambda n: (int(n)+1)/2, input().split()))

mx = sum(ps[:k])
for i in range(1, n - (k-1)):
  if ps[i-1] < ps[i+k-1]:
    mx = sum(ps[i:i+k])
print(mx)
a = list(map(int,input().split()))
p = list(map(int,input().split()))
n = a[0]
k = a[1]

E = [0]*n
sum_E = 0
max_E = 0

for i in range(n):
  sum_E += (p[i]+1)/2
  E[i] = sum_E

for i in range(n-k):
  if max_E < E[i+k] - E[i]:
    max_E = E[i+k] - E[i]

print(max_E)
N, K = map(int, input().split())
p = sorted(list(map(int, input().split())))
ans = 0
for i in range(1, K + 1):
  count = 0
  count += (p[-i] * (p[-i] + 1)) / 2
  ans += (count / p[-i])
print(ans)
n,k = map(int, input().split())
p = list(map(int, input().split()))

mxidx = 0
mx = 0
tot=0
for i in range(k):
    tot+=p[i]
mx=tot
for i in range(k,n):
    tot+=p[i]-p[i-k]
    if tot>mx:
        mxidx=i-k+1

ans=0
for i in range(mxidx, mxidx+k):
    ans+=(1+p[i])/2

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

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

ans = 0
for n in p[idx:idx+k]:
    ans += (n + 1) * 0.5
print('{:.7f}'.format(float(ans)))
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[a[0]]
for i in range(1,n):
    b.append(b[-1]+a[i])
max=0
for j in range(k,len(b)):
    if max<b[j]-b[j-k]:
        max=b[j]-b[j-k]
print((max+k)/2)
N,K = list(map(str,input().split()))
P = list(map(int, input().split()))
K=int(K)

ans=0
for i in range(len(P)-K):
    tmp_ans=sum(P[i+1:i+K+1])
    # print(tmp_ans)
    if ans<tmp_ans:
        ans=tmp_ans
        # print(ans)
        # print(K)

print((ans+K)/2)
def expct(x):
  return (x+1)/2

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

expt=list(map(expct,p))

#print(expt[1:k])

maxval=sum(expt[1:k])

for i in range(2,n-k+1):
  curval=sum(expt[i:i+k])
#  print(maxval,curval)
  if curval>maxval:
    maxval=curval

print(maxval)
NK = input().split()
N, K = int(NK[0]), int(NK[1])
lis_p = list(map(lambda x: int(x), input().split()))
lis_exp = list(map(lambda x: x*(x+1)/2/x, lis_p))
dp=0
for i in range(N):
    print(i)
    dp = max(sum(lis_exp[i:i+K]), dp)
print(dp)
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=0
for i in range(len(p)-k):
    l=sum(p[i:i+k])
    s=max(s,l)
print((s+k)/2)
N, K = map(int, input().split())
P = list(map(int, input().split()))

m = [(e + 1) / 2 for e in range(N)]

t = sum(m[0:K])
ans = t
for i in range(N - K):
    t -= m[i]
    t += m[i + K]
    if t > ans:
        ans = t
print(ans)
import numpy as np
N,K=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(list(map(lambda x: (1+x)/2, p)))
mx_0 = np.sum(p[:K])
mx=0
#print(p)
for i in range(1,N-K+1):
  #print(p)
  #print(p[i-1],p[i+K-1])
  s = mx_0-p[i-1]+p[i+K-1]
  mx_0=s
  #print(s)
  mx = max(s,mx)
  
print(mx)
n,k=map(int, input().split())
p=list(map(int, input().split()))
ans = 0.0
ksum = sum(p[0:k])
kans = ksum/2 + k*0.5
for i in range(n-k):
    ksum = ksum -p[i] +p[i+k]
    kans = ksum/2 + k*0.5
    if ans < kans:
        ans = kans
print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
l = sum(p[:k])
ans = [l]
for i in range(k+1,n):
    m = l+p[i]-p[i-k-1]
    l = m
    ans.append(m)
print((max(ans)+k)/2)
def __main():
    n,k = map(int, input().split())
    P = list(map(int, input().split()))
    P = list(map(lambda x:(x+1)/2, P))

    cur = sum(P[:k])
    #print('first ', cur)
    ans = 0

    for i in range(1, n-k+1):
        cur += P[i+k-1] - P[i-1]
        if cur < ans: continue
        ans = cur

    print(ans)
__main()
x=0
N,K=map(int,input().split())
P=list(map(float,input().split()))
S=[]
for i in range(N):
  a=float((1+P[i])*P[i]/2)
  v=float(a/P[i])
  S.append(v)
#print(S)
i=1
while i+K<N+1:
  #T.append(sum(S[i:i+K]))
  x=max(x,sum(S[i:i+K]))
  i=i+1
#print(S)
#print(T)
print("{0:.12f}".format(x))
n, k = map(int, input().split())
list_score = list(map(int, input().split()))

list_ans = []

for i in range(n-k+1):
    list_sum = list_score[i:i+k]
    list_ans.append(sum(list_sum))

list_ans.sort



ans = list_ans[-1]*0.5 + 0.5*k

print(ans)
N,K=map(int,input().split())
*p,= map(int, input().split())

def ex(n):
    return sum(range(1,n+1))/n    
def  ex3(p):
    return sum([ex(n) for n in p])
dp=[0 for _ in range(N)]

M,mi=0,0
for i in range(N-K+1):
    s=sum(p[i:i+K+1])
    if s>M:
        M=s
        mi=i
print(ex3(p[mi+1:mi+K+1]))
N,K = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(N):
  p[i] = (p[i]+1)/2
total = sum(p[:K])
for j in range(N-K):
  total = total+p[K+j]-p[j]
  ans = max(ans,total)
print(ans)
n,k=map(int,input().split())
data=list(map(float,input().split()))
new_data=[0]*n
for i in range(len(data)):
    new_data[i]=(data[i]+1)/2
temp=0
for i in range(k):
    temp+=new_data[i]
ans=0
for i in range(k,len(data)):
    temp=temp-new_data[i-k]+new_data[i]
    ans=max(ans,temp)
print(ans)
N,K=map(int,input().split())
P=list(map(int,input().split()))
L=[]
M=[]
c=0
m=0
x=0
for i in range(200100):
    c+=i
    L.append(c)
for i in P:
    m+=L[i]/i
    M.append(m)
for i in range(N-K):
    x=max(M[K+i]-M[i],x)
print(x)
import numpy as np

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

p = np.array(p)
p = np.cumsum(p)

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

print(ans)
def dice(num):
  return 0.5 * (num * (num + 1)) / num

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

pp = len(p)
sum = 0
ii = 0
for i in range(1, pp - k):
  temp = 0
  for kk in range(0, k):
  	temp += p[i+kk] 
  if temp > sum:
    ii = i

ans = 0.0
for kk in range(0, k):
  ans += dice(p[ii+kk])

print(ans)
M,N = list(map(int,input().split()))
s = list(map(int,input().split()))
count = 0
kiroku = 0

t = [0 for i in range(M+1)]
for i in range(M):
    t[i+1] = t[i] + s[i]

for i in range(N,M-N+1):
    if t[i] -t[i-N] > count:
        count = t[i] -t[i-N]
        kiroku = i
b = 0
for i in range(kiroku-N,kiroku):
    a = (1+s[i])/2
    b += a

if b >= 0:
    print(b)
else:
    print(0)
N,K=map(int,input().split())
P=list(map(int,input().split()))
L=[]
M=[]
c=0
m=0
x=0
for i in range(200001):
    c+=i
    L.append(c)
for i in P:
    m+=L[i]/i
    M.append(m)
for i in range(N-K):
    x=max(M[K+i]-M[i],x)
print(x)
def resolve_D():
    max_ = 0
    res = 0
    n, k = map(int, input().split())
    l = list(map(int, input().split()))
    for i in range(0, n-k+1):
        total = sum(l[i:i+k])
        if total > max_:
            max_ = total
            max_i = i
    for j in l[max_i:max_i+k]:
        res += j * (j + 1) / 2 / j
    print(res)
N,K=map(int,input().split())
L=list(map(int,input().split()))
E=[(v+1)//2 for v in L]
ans=sum(E[:K])
last=E[0]
for l in E[K:]:
  ans = max(ans,ans-last+l)
  last = l
print(ans)
import numpy as np
N,K = map(int,input().split())
p = list(map(int,input().split()))

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

a = [0] * N
a[0] = l[0]
for i in range(1,len(l)):
    a[i] = a[i-1] + l[i]

ans = 0
for i in range(K,len(l)):
    ans = max(ans,a[i]-a[i-K])

if N == 1:
    print(l[0])
else:
    print(ans)
from decimal import Decimal

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

P2 = [Decimal(n*(n+1))/(2*n) for n in P]

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

    max_s = max(max_s, S)

# print(f'{max_s:.9f}')
print('{:.10f}'.format(max_s))
def main():
    N, K = [int(s) for s in input().split()]
    p = [int(s) for s in input().split()]
    s = sum(p[:K])
    res = 0
    for i in range(1,N):
        if i+K > N:
            break
        s = s + p[i+K-1]
        s = s - p[i-1]
        res = max(s,res)
        
    print((res+K)/2)

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

#そのサイコロの期待値の合計
e_list = []
for i in range(N):
    e_list.append((1+p_list[i])/2.0)

#累積和
s_list = []
for i in range(N):
    s_list.append(sum(e_list[:i+1]))

#隣接するk個の和
dst = 0
for i in range(N-K+1):
    s_sum = s_list[i+K-1] - s_list[i]
    if dst < s_sum:
        dst = s_sum
print(dst)
N,K = map(int,input().split())
p = list(map(int, input().split()))


s = sum(p[0:K])
s_max = s

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

    if s_max < s:
        s_max = s

print((s_max+K)/2)
def dice_in_line(k, p_list):
    max_line = [0 for i in range(k+1)]
    for i in range(len(p_list)-2):
        print(i)
        if sum(p_list[i:i+k]) > max_line[-1]:
            max_line = p_list[i:i+k]
            max_line.append(sum(max_line[0:k]))
    return (max_line[-1]+k)/2.0

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

print(dice_in_line(k, p_list))
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
for i in range(k):
    ans += (p[i] + 1) / 2
calc = ans
print(ans)
for i in range(1, n - k + 1):
    calc += ((p[i + k - 1] + 1) - (p[i - 1] + 1)) / 2
    ans = max(ans, calc)
print(ans)
#At coder 2020/2/9 D

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=0.0
if N==K:
    kk=sum(p)
else:
    for ii in range(N-K):
        kk=max(kk,sum(p[ii:K+ii]))
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

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

st_idx  = 0
max_sum = 0
for nn in range( K ):
    max_sum += P[nn]

tmp = max_sum
for nn in range( K, len(P) ):
    tmp -= P[nn-K]
    tmp += P[nn]
    if( tmp > max_sum ):
        st_idx = nn-K+1
    
ans = 0
for nn in range( st_idx, st_idx+K ):
    tmp = ( 1 + P[nn] ) / 2
    ans += tmp
        
print( ans )
a,b = map(int, input().split())
l = [(int(i)+1)/2 for i in input().split()]
l.append(0)
print(l)
st = sum(l[:b])
temp = st
max = 0
for i in range(b,a-b+1):
  temp = temp + l[i] - l[i-b]
  if max < temp:
    max = temp
    
print(max)
a,b = map(int, input().split())
l = [(int(i)+1)/2 for i in input().split()]
l.append(0)
temp = sum(l[:b])
max = 0
for i in range(b,a+1):
  temp = temp + l[i] - l[i-b]
  if max < temp:
    max = temp
    
print(max)
#154_C
n, k = map(int, input().split())
p = list(map(int, input().split()))

E = []
for i in range(n):
    e = (p[i]+1.0) / 2.0
    E.append(e)
    
ans = 0
for i in range(n-k):
    now = 0
    for j in range(k):
        now += E[i+j]
    ans = max(ans, now)

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

S = [0]
E = []

for i in range(N):
    S.append(sum(p[0:i]))

for i in range(N-K+1):
    E.append(S[i+K]-S[i])


print((max(E)+K)/2)
import numpy as np
K,N = list(map(int,input().split()))
arr = np.array(list(map(int,input().split())))
arr = arr.cumsum()
_sum = 0
for i in range(len(arr)-N+1):
  if i==0:
    tmp = arr[N-1]
  else:
    tmp = arr[N+i-1]-arr[i-1]
  _sum = max(_sum,tmp)

print((_sum+N)//2)
N,K = map(int,input().split())
ds = map(int,input().split())
exps = [(d+1)/2 for d in ds]
out = 0
for i in range(N-2):
    out = max(out,sum(exps[i:i+K]))
print(out)
n,k = map(int,input().split())
list = list(map(int,input().split()))
list.sort(reverse=True)

list_ans = list[0:k]
ans = 0
i = 0
while i < len(list_ans):
    ans += (list_ans[i]+1)/2
    i += 1
    
print(ans)
N,K=map(int, input().split())
p = list(map(int, input().split()))

#p = [(n+1)/2 for n in p]
import numpy as np
s = np.cumsum(p)

e=s[K-1]
max_e=(K+e)/2
for i in range(0,N-K-1):
  e=s[i+K]-s[i]
  #print(e)
  e=(K+e)/2
  #print(e)
  max_e = max(max_e, e)
    
print(max_e)
N,K,*P = map(int,open(0).read().split())
P = [(P[i]+1)/2 for i in range(N)]
S = [sum(P[:i+1]) for i in range(N)]

m = 0 
for i in range(N-K):
  if m < S[i+K]-S[i]:
    m= S[i+K]-S[i]
print(m)