import sys


def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    s = sum(p[:k])
    max_sum = s
    for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
    print((k + max_sum) / 2)


if __name__ == "__main__":
    main() import sys sys def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    s = sum(p[:k])
    max_sum = s
    for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
    print((k + max_sum) / 2) main input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer 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 s = sum(p[:k]) s sum(p[:k]) sum p[:k] p :k k max_sum = s max_sum s for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
     i range(k, n) range k n s += p[i] s p[i] p i s -= p[i - k] s p[i - k] p i - k i k max_sum = max(max_sum, s) max_sum max(max_sum, s) max max_sum s print((k + max_sum) / 2) print (k + max_sum) / 2 k + max_sum k max_sum 2 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    s = sum(p[:k])
    max_sum = s
    for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
    print((k + max_sum) / 2) def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    s = sum(p[:k])
    max_sum = s
    for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
    print((k + max_sum) / 2) main
import sys


def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    s = sum(p[:k])
    max_sum = s
    for i in range(k, n):
        s += p[i]
        s -= p[i - k]
        max_sum = max(max_sum, s)
    print((k + max_sum) / 2)


if __name__ == "__main__":
    main()
