# coding=UTF-8
from collections import deque
from operator import itemgetter
from bisect import bisect_left, bisect
import itertools
import sys
import math
import numpy as np
import time
sys.setrecursionlimit(10**6)
input = sys.stdin.readline


def ev(n):
    return 0.5*(n+1)


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

    p_ev = list(map(ev, p))

    s = np.cumsum(p_ev)
    s = np.insert(s, 0, 0)

    ans = []

    for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

    print(max(ans))


if __name__ == '__main__':
    main() from collections import deque from operator import itemgetter from bisect import bisect_left, bisect import itertools itertools import sys sys import math math import numpy as np numpy import time time sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def ev(n):
    return 0.5*(n+1) ev return 0.5*(n+1) 0.5*(n+1) 0.5 n+1 n 1 n n def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    p_ev = list(map(ev, p))

    s = np.cumsum(p_ev)
    s = np.insert(s, 0, 0)

    ans = []

    for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

    print(max(ans)) main 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 p_ev = list(map(ev, p)) p_ev list(map(ev, p)) list map(ev, p) map ev p s = np.cumsum(p_ev) s np.cumsum(p_ev) np.cumsum np cumsum p_ev s = np.insert(s, 0, 0) s np.insert(s, 0, 0) np.insert np insert s 0 0 ans = [] ans [] for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

     i range(n - k+1) range n - k+1 n - k n k 1 ans.append(s[i + k] - s[i]) ans.append ans append s[i + k] - s[i] s[i + k] s i + k i k s[i] s i print(max(ans)) print max(ans) max ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def ev(n):
    return 0.5*(n+1) def ev(n):
    return 0.5*(n+1) ev def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    p_ev = list(map(ev, p))

    s = np.cumsum(p_ev)
    s = np.insert(s, 0, 0)

    ans = []

    for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

    print(max(ans)) def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))

    p_ev = list(map(ev, p))

    s = np.cumsum(p_ev)
    s = np.insert(s, 0, 0)

    ans = []

    for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

    print(max(ans)) main input = sys.stdin.readline sys.stdin.readline input
# coding=UTF-8
from collections import deque
from operator import itemgetter
from bisect import bisect_left, bisect
import itertools
import sys
import math
import numpy as np
import time
sys.setrecursionlimit(10**6)
input = sys.stdin.readline


def ev(n):
    return 0.5*(n+1)


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

    p_ev = list(map(ev, p))

    s = np.cumsum(p_ev)
    s = np.insert(s, 0, 0)

    ans = []

    for i in range(n - k+1):
        ans.append(s[i + k] - s[i])

    print(max(ans))


if __name__ == '__main__':
    main()
