def solve():
    N,K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    prev_K_sum = max_K_sum = sum(P[:K])
    start = 0
    for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
    target = P[start:start+K]
    ans = sum([(num+1)/2.0 for num in target])
    print(ans)

if __name__ == "__main__":
    solve() def solve():
    N,K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    prev_K_sum = max_K_sum = sum(P[:K])
    start = 0
    for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
    target = P[start:start+K]
    ans = sum([(num+1)/2.0 for num in target])
    print(ans) solve 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 N,K = [int(i) for i in input().split()] N [int(i) for i in input().split()] K 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 P = [int(i) for i in input().split()] P [int(i) for i in input().split()] prev_K_sum = max_K_sum = sum(P[:K]) prev_K_sum sum(P[:K]) sum P[:K] P :K K = max_K_sum = sum(P[:K]) max_K_sum sum(P[:K]) start = 0 start 0 for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
     i range(N-K) range N-K N K cur_K_sum = prev_K_sum - P[i] + P[i+K] cur_K_sum prev_K_sum - P[i] + P[i+K] prev_K_sum - P[i] prev_K_sum P[i] P i P[i+K] P i+K i K if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
         cur_K_sum > max_K_sum cur_K_sum max_K_sum start = i + 1 start i + 1 i 1 max_K_sum = cur_K_sum max_K_sum cur_K_sum prev_K_sum = cur_K_sum prev_K_sum cur_K_sum target = P[start:start+K] target P[start:start+K] P start:start+K start start+K start K (num+1)/2.0 for num in target for num in target num target for num in target (num+1)/2.0 num+1 num 1 2.0 ans = sum([(num+1)/2.0 for num in target]) ans sum([(num+1)/2.0 for num in target]) sum [(num+1)/2.0 for num in target] print(ans) print ans if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    N,K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    prev_K_sum = max_K_sum = sum(P[:K])
    start = 0
    for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
    target = P[start:start+K]
    ans = sum([(num+1)/2.0 for num in target])
    print(ans) def solve():
    N,K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    prev_K_sum = max_K_sum = sum(P[:K])
    start = 0
    for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
    target = P[start:start+K]
    ans = sum([(num+1)/2.0 for num in target])
    print(ans) solve
def solve():
    N,K = [int(i) for i in input().split()]
    P = [int(i) for i in input().split()]
    prev_K_sum = max_K_sum = sum(P[:K])
    start = 0
    for i in range(N-K):
        cur_K_sum = prev_K_sum - P[i] + P[i+K]
        if cur_K_sum > max_K_sum:
            start = i + 1
            max_K_sum = cur_K_sum
        prev_K_sum = cur_K_sum
    target = P[start:start+K]
    ans = sum([(num+1)/2.0 for num in target])
    print(ans)

if __name__ == "__main__":
    solve()