import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    e_value = [(1 + i)/2 for i in p]
    c_value = [e_value[0]]
    for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
    ans = 0
    for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
    print(ans)
    
if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    e_value = [(1 + i)/2 for i in p]
    c_value = [e_value[0]]
    for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
    ans = 0
    for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
    print(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 (1 + i)/2 for i in p for i in p i p for i in p (1 + i)/2 1 + i 1 i 2 e_value = [(1 + i)/2 for i in p] e_value [(1 + i)/2 for i in p] c_value = [e_value[0]] c_value [e_value[0]] e_value[0] e_value 0 for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
     i range(1, n) range 1 n c_value.append(c_value[i-1] + e_value[i]) c_value.append c_value append c_value[i-1] + e_value[i] c_value[i-1] c_value i-1 i 1 e_value[i] e_value i ans = 0 ans 0 for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
     i range(k-1, n) range k-1 k 1 n if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
     i == k-1 i k-1 k 1 ans = c_value[i] ans c_value[i] c_value i ans = max(ans, c_value[i]-c_value[i-k]) ans max(ans, c_value[i]-c_value[i-k]) max ans c_value[i]-c_value[i-k] c_value[i] c_value i c_value[i-k] c_value i-k i k print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    e_value = [(1 + i)/2 for i in p]
    c_value = [e_value[0]]
    for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
    ans = 0
    for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
    print(ans)
     def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    e_value = [(1 + i)/2 for i in p]
    c_value = [e_value[0]]
    for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
    ans = 0
    for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
    print(ans)
     main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, k = map(int, input().split())
    p = list(map(int, input().split()))
    e_value = [(1 + i)/2 for i in p]
    c_value = [e_value[0]]
    for i in range(1, n):
        c_value.append(c_value[i-1] + e_value[i])
    ans = 0
    for i in range(k-1, n):
        if i == k-1:
            ans = c_value[i]
        else:
            ans = max(ans, c_value[i]-c_value[i-k])
    print(ans)
    
if __name__ == '__main__':
    main()