# https://atcoder.jp/contests/abc154/tasks/abc154_d
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, k = input_int_list()
    P = [0] + input_int_list()
    expected_sum = [0] * (n + 1)
    # pre-process
    for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
    ans = 0
    # query from cusum
    for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
    print(ans)
    return


if __name__ == "__main__":
    main() import sys sys def input():
    return sys.stdin.readline().strip() input return sys.stdin.readline().strip() sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip def input_int():
    return int(input()) input_int return int(input()) int(input()) int input() input def input_int_list():
    return [int(i) for i in input().split()] input_int_list int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i return [int(i) for i in input().split()] [int(i) for i in input().split()] def main():
    n, k = input_int_list()
    P = [0] + input_int_list()
    expected_sum = [0] * (n + 1)
    # pre-process
    for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
    ans = 0
    # query from cusum
    for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
    print(ans)
    return main n, k = input_int_list() n input_int_list() input_int_list k P = [0] + input_int_list() P [0] + input_int_list() [0] 0 input_int_list() input_int_list expected_sum = [0] * (n + 1) expected_sum [0] * (n + 1) [0] 0 n + 1 n 1 for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
     i range(1, n + 1) range 1 n + 1 n 1 exp = (P[i] + 1) / 2 exp (P[i] + 1) / 2 P[i] + 1 P[i] P i 1 2 expected_sum[i] = expected_sum[i - 1] + exp expected_sum[i] expected_sum i expected_sum[i - 1] + exp expected_sum[i - 1] expected_sum i - 1 i 1 exp ans = 0 ans 0 for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
     i range(k, n + 1) range k n + 1 n 1 ans = max(ans, expected_sum[i] - expected_sum[i - k]) ans max(ans, expected_sum[i] - expected_sum[i - k]) max ans expected_sum[i] - expected_sum[i - k] expected_sum[i] expected_sum i expected_sum[i - k] expected_sum i - k i k print(ans) print ans return if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input():
    return sys.stdin.readline().strip() def input():
    return sys.stdin.readline().strip() input def input_int():
    return int(input()) def input_int():
    return int(input()) input_int def input_int_list():
    return [int(i) for i in input().split()] def input_int_list():
    return [int(i) for i in input().split()] input_int_list def main():
    n, k = input_int_list()
    P = [0] + input_int_list()
    expected_sum = [0] * (n + 1)
    # pre-process
    for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
    ans = 0
    # query from cusum
    for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
    print(ans)
    return def main():
    n, k = input_int_list()
    P = [0] + input_int_list()
    expected_sum = [0] * (n + 1)
    # pre-process
    for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
    ans = 0
    # query from cusum
    for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
    print(ans)
    return main
# https://atcoder.jp/contests/abc154/tasks/abc154_d
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n, k = input_int_list()
    P = [0] + input_int_list()
    expected_sum = [0] * (n + 1)
    # pre-process
    for i in range(1, n + 1):
        exp = (P[i] + 1) / 2
        expected_sum[i] = expected_sum[i - 1] + exp
    ans = 0
    # query from cusum
    for i in range(k, n + 1):
        ans = max(ans, expected_sum[i] - expected_sum[i - k])
    print(ans)
    return


if __name__ == "__main__":
    main()
