import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, K = map(int, readline().split())
    P = [0] + list(map(int, readline().split()))

    cur = sum(P[:K])
    s_max = 0

    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

    print((s_max + K) / 2)


if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    N, K = map(int, readline().split())
    P = [0] + list(map(int, readline().split()))

    cur = sum(P[:K])
    s_max = 0

    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

    print((s_max + K) / 2) main N, K = map(int, readline().split()) N map(int, readline().split()) map int readline().split() ().split () readline split K P = [0] + list(map(int, readline().split())) P [0] + list(map(int, readline().split())) [0] 0 list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split cur = sum(P[:K]) cur sum(P[:K]) sum P[:K] P :K K s_max = 0 s_max 0 for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

     i range(N - K + 1) range N - K + 1 N - K N K 1 cur += P[K + i] cur P[K + i] P K + i K i cur -= P[i] cur P[i] P i s_max = max(s_max, cur) s_max max(s_max, cur) max s_max cur print((s_max + K) / 2) print (s_max + K) / 2 s_max + K s_max K 2 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.readline sys.stdin.readline readline def main():
    N, K = map(int, readline().split())
    P = [0] + list(map(int, readline().split()))

    cur = sum(P[:K])
    s_max = 0

    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

    print((s_max + K) / 2) def main():
    N, K = map(int, readline().split())
    P = [0] + list(map(int, readline().split()))

    cur = sum(P[:K])
    s_max = 0

    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

    print((s_max + K) / 2) main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD INF = float('INF') float('INF') INF
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N, K = map(int, readline().split())
    P = [0] + list(map(int, readline().split()))

    cur = sum(P[:K])
    s_max = 0

    for i in range(N - K + 1):
        cur += P[K + i]
        cur -= P[i]
        s_max = max(s_max, cur)

    print((s_max + K) / 2)


if __name__ == '__main__':
    main()
