import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import accumulate
def main():
    n, k, *p = map(int, read().split())
    p2 = [0] + [(1 + pe) / 2 for pe in p]
    r = 0
    p2a = tuple(accumulate(p2))
    for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
    print(r)

if __name__ == '__main__':
    main() import sys sys read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read readlines = sys.stdin.readlines readlines sys.stdin.readlines sys.stdin sys stdin readlines from itertools import accumulate def main():
    n, k, *p = map(int, read().split())
    p2 = [0] + [(1 + pe) / 2 for pe in p]
    r = 0
    p2a = tuple(accumulate(p2))
    for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
    print(r) main n, k, *p = map(int, read().split()) n map(int, read().split()) map int read().split() ().split () read split k *p p (1 + pe) / 2 for pe in p for pe in p pe p for pe in p (1 + pe) / 2 1 + pe 1 pe 2 p2 = [0] + [(1 + pe) / 2 for pe in p] p2 [0] + [(1 + pe) / 2 for pe in p] [0] 0 [(1 + pe) / 2 for pe in p] r = 0 r 0 p2a = tuple(accumulate(p2)) p2a tuple(accumulate(p2)) tuple accumulate(p2) accumulate p2 for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
     i1 range(k, n+1) range k n+1 n 1 r = max(r, p2a[i1] - p2a[i1-k]) r max(r, p2a[i1] - p2a[i1-k]) max r p2a[i1] - p2a[i1-k] p2a[i1] p2a i1 p2a[i1-k] p2a i1-k i1 k print(r) print r if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main read = sys.stdin.read sys.stdin.read read readlines = sys.stdin.readlines sys.stdin.readlines readlines def main():
    n, k, *p = map(int, read().split())
    p2 = [0] + [(1 + pe) / 2 for pe in p]
    r = 0
    p2a = tuple(accumulate(p2))
    for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
    print(r) def main():
    n, k, *p = map(int, read().split())
    p2 = [0] + [(1 + pe) / 2 for pe in p]
    r = 0
    p2a = tuple(accumulate(p2))
    for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
    print(r) main
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import accumulate
def main():
    n, k, *p = map(int, read().split())
    p2 = [0] + [(1 + pe) / 2 for pe in p]
    r = 0
    p2a = tuple(accumulate(p2))
    for i1 in range(k, n+1):
        r = max(r, p2a[i1] - p2a[i1-k])
    print(r)

if __name__ == '__main__':
    main()
