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