import sys
from collections import defaultdict
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

d = defaultdict(float)
for i in range(1, 1001):
    j = i
    while 0 < j:
        t = j * (1 / i)
        d[i] += t
        j -= 1

sum = [0.0]*(n+1)
for i in range(n):
    sum[i+1] = sum[i] + d[p[i]]

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

print('{:.12f}'.format(ans)) import sys sys from collections import defaultdict sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline 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 d = defaultdict(float) d defaultdict(float) defaultdict float for i in range(1, 1001):
    j = i
    while 0 < j:
        t = j * (1 / i)
        d[i] += t
        j -= 1 i range(1, 1001) range 1 1001 j = i j i while 0 < j:
        t = j * (1 / i)
        d[i] += t
        j -= 1 0 < j 0 j t = j * (1 / i) t j * (1 / i) j 1 / i 1 i d[i] += t d[i] d i t j -= 1 j 1 sum = [0.0]*(n+1) sum [0.0]*(n+1) [0.0] 0.0 n+1 n 1 for i in range(n):
    sum[i+1] = sum[i] + d[p[i]] i range(n) range n sum[i+1] = sum[i] + d[p[i]] sum[i+1] sum i+1 i 1 sum[i] + d[p[i]] sum[i] sum i d[p[i]] d p[i] p i ans = 0 ans 0 for i in range(k-1, n+1):
    tmp = sum[i] - sum[i-k]
    ans = max(ans,tmp) i range(k-1, n+1) range k-1 k 1 n+1 n 1 tmp = sum[i] - sum[i-k] tmp sum[i] - sum[i-k] sum[i] sum i sum[i-k] sum i-k i k ans = max(ans,tmp) ans max(ans,tmp) max ans tmp print('{:.12f}'.format(ans)) print '{:.12f}'.format(ans) '{:.12f}'.format '{:.12f}' format ans j -= 1 1 j ans = 0 0 ans p = list(map(int, input().split())) list(map(int, input().split())) p sum = [0.0]*(n+1) [0.0]*(n+1) sum n,k = map(int, input().split()) map(int, input().split()) n input = sys.stdin.readline sys.stdin.readline input tmp = sum[i] - sum[i-k] sum[i] - sum[i-k] tmp j = i i j ans = max(ans,tmp) max(ans,tmp) ans k = map(int, input().split()) map(int, input().split()) k d = defaultdict(float) defaultdict(float) d t = j * (1 / i) j * (1 / i) t
import sys
from collections import defaultdict
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

d = defaultdict(float)
for i in range(1, 1001):
    j = i
    while 0 < j:
        t = j * (1 / i)
        d[i] += t
        j -= 1

sum = [0.0]*(n+1)
for i in range(n):
    sum[i+1] = sum[i] + d[p[i]]

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

print('{:.12f}'.format(ans))
