from sys import stdin, setrecursionlimit





def main():

    n, k = list(map(int, stdin.readline().split()))

    p = list(map(int, stdin.readline().split()))



    sp = [0] * 1001



    for i in range(1, 1001):

        sp[i] = sum(range(i + 1)) / i



    summary = [0] * n

    summary[0] = sp[p[0]]

    for i in range(1, n):

        summary[i] = summary[i - 1] + sp[p[i]]



    max = summary[k - 1]

    for i in range(k, n):

        tmp = summary[i] - summary[i - k]

        if tmp > max:

            max = tmp

    print(max)





if __name__ == "__main__":

    setrecursionlimit(10000)

    main()
from sys import stdin, setrecursionlimit





def main():

    input = stdin.buffer.readline

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

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



    e = [i * (i + 1) / (2 * i) for i in range(1, 1001)]



    sum = [0] * n

    sum[0] = e[p[0] - 1]

    for i in range(1, n):

        sum[i] = sum[i - 1] + e[p[i] - 1]



    max = sum[k - 1]

    for i in range(k, n):

        if max < sum[i] - sum[i - k]:

            max = sum[i] - sum[i - k]



    print(max)





if __name__ == "__main__":

    setrecursionlimit(10000)

    main()

from sys import stdin, setrecursionlimit


def main():
    n, k = list(map(int, stdin.readline().split()))
    p = list(map(int, stdin.readline().split()))
    sp = [0] * 1001
    for i in range(1, 1001):
        sp[i] = sum(range(i + 1)) / i
    summary = [0] * n
    summary[0] = sp[p[0]]
    for i in range(1, n):
        summary[i] = summary[i - 1] + sp[p[i]]
    max = summary[k - 1]
    for i in range(k, n):
        tmp = summary[i] - summary[i - k]
        if tmp > max:
            max = tmp
    print(max)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, k = list(map(int, input().split()))
    p = list(map(int, input().split()))
    e = [i * (i + 1) / (2 * i) for i in range(1, 1001)]
    sum = [0] * n
    sum[0] = e[p[0] - 1]
    for i in range(1, n):
        sum[i] = sum[i - 1] + e[p[i] - 1]
    max = sum[k - 1]
    for i in range(k, n):
        if max < sum[i] - sum[i - k]:
            max = sum[i] - sum[i - k]
    print(max)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

-    n, k = list(map(int, stdin.readline().split())) -    p = list(map(int, stdin.readline().split())) -    sp = [0] * 1001 -    for i in range(1, 1001): -        sp[i] = sum(range(i + 1)) / i -    summary = [0] * n -    summary[0] = sp[p[0]] +    input = stdin.buffer.readline +    n, k = list(map(int, input().split())) +    p = list(map(int, input().split())) +    e = [i * (i + 1) / (2 * i) for i in range(1, 1001)] +    sum = [0] * n +    sum[0] = e[p[0] - 1] -        summary[i] = summary[i - 1] + sp[p[i]] -    max = summary[k - 1] +        sum[i] = sum[i - 1] + e[p[i] - 1] +    max = sum[k - 1] -        tmp = summary[i] - summary[i - k] -        if tmp > max: -            max = tmp +        if max < sum[i] - sum[i - k]: +            max = sum[i] - sum[i - k]