N,K = map(int,input().split())
ps = list(map(int,input().split()))
su = sum(ps[0:K])
ksum = su
ind = 0
for i in range(1,N-K+1):
    ksum -= ps[i-1]
    ksum += ps[i+K-1]
    if ksum > su:
        ind = i
        su = ksum
ki = 0

for i in range(ind, ind+K):
    ki += (ps[i]*(ps[i]+1))/2/ps[i]
print(ki) N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K ps = list(map(int,input().split())) ps list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split su = sum(ps[0:K]) su sum(ps[0:K]) sum ps[0:K] ps 0:K 0 K ksum = su ksum su ind = 0 ind 0 for i in range(1,N-K+1):
    ksum -= ps[i-1]
    ksum += ps[i+K-1]
    if ksum > su:
        ind = i
        su = ksum i range(1,N-K+1) range 1 N-K+1 N-K N K 1 ksum -= ps[i-1] ksum ps[i-1] ps i-1 i 1 ksum += ps[i+K-1] ksum ps[i+K-1] ps i+K-1 i+K i K 1 if ksum > su:
        ind = i
        su = ksum ksum > su ksum su ind = i ind i su = ksum su ksum ki = 0 ki 0 for i in range(ind, ind+K):
    ki += (ps[i]*(ps[i]+1))/2/ps[i] i range(ind, ind+K) range ind ind+K ind K ki += (ps[i]*(ps[i]+1))/2/ps[i] ki (ps[i]*(ps[i]+1))/2/ps[i] (ps[i]*(ps[i]+1))/2 ps[i]*(ps[i]+1) ps[i] ps i ps[i]+1 ps[i] ps i 1 2 ps[i] ps i print(ki) print ki ksum = su su ksum ind = i i ind su = sum(ps[0:K]) sum(ps[0:K]) su ps = list(map(int,input().split())) list(map(int,input().split())) ps su = ksum ksum su ki = 0 0 ki ind = 0 0 ind K = map(int,input().split()) map(int,input().split()) K ki += (ps[i]*(ps[i]+1))/2/ps[i] (ps[i]*(ps[i]+1))/2/ps[i] ki ksum += ps[i+K-1] ps[i+K-1] ksum N,K = map(int,input().split()) map(int,input().split()) N ksum -= ps[i-1] ps[i-1] ksum
N,K = map(int,input().split())
ps = list(map(int,input().split()))
su = sum(ps[0:K])
ksum = su
ind = 0
for i in range(1,N-K+1):
    ksum -= ps[i-1]
    ksum += ps[i+K-1]
    if ksum > su:
        ind = i
        su = ksum
ki = 0

for i in range(ind, ind+K):
    ki += (ps[i]*(ps[i]+1))/2/ps[i]
print(ki)
