def calc_ex(P):
    sum = 0
    for p in range(1, P+1):
        sum += p
    return sum / P

def main():
    N, K = map(int,input().split())
    P = list(map(int,input().split()))
    accumP = [0] * (N + 1)
    for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
    idx = 0
    sum = accumP[idx+K] - accumP[idx] 
    for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
    ans = 0
    for i in range(idx, idx+K):
        ans += calc_ex(P[i])

    print(ans)

if __name__ == "__main__":
    main() def calc_ex(P):
    sum = 0
    for p in range(1, P+1):
        sum += p
    return sum / P calc_ex sum = 0 sum 0 for p in range(1, P+1):
        sum += p
     p range(1, P+1) range 1 P+1 P 1 sum += p sum p return sum / P sum / P sum P P P def main():
    N, K = map(int,input().split())
    P = list(map(int,input().split()))
    accumP = [0] * (N + 1)
    for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
    idx = 0
    sum = accumP[idx+K] - accumP[idx] 
    for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
    ans = 0
    for i in range(idx, idx+K):
        ans += calc_ex(P[i])

    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 accumP = [0] * (N + 1) accumP [0] * (N + 1) [0] 0 N + 1 N 1 for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
     i range(N) range N accumP[i+1] = accumP[i] + P[i] accumP[i+1] accumP i+1 i 1 accumP[i] + P[i] accumP[i] accumP i P[i] P i idx = 0 idx 0 sum = accumP[idx+K] - accumP[idx] sum accumP[idx+K] - accumP[idx] accumP[idx+K] accumP idx+K idx K accumP[idx] accumP idx for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
     i range(0, N-K+1) range 0 N-K+1 N-K N K 1 if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
     accumP[i+K] - accumP[i] > sum accumP[i+K] - accumP[i] accumP[i+K] accumP i+K i K accumP[i] accumP i sum idx = i idx i sum = accumP[i+K] - accumP[i] sum accumP[i+K] - accumP[i] accumP[i+K] accumP i+K i K accumP[i] accumP i ans = 0 ans 0 for i in range(idx, idx+K):
        ans += calc_ex(P[i])

     i range(idx, idx+K) range idx idx+K idx K ans += calc_ex(P[i]) ans calc_ex(P[i]) calc_ex P[i] P i 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()))
    accumP = [0] * (N + 1)
    for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
    idx = 0
    sum = accumP[idx+K] - accumP[idx] 
    for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
    ans = 0
    for i in range(idx, idx+K):
        ans += calc_ex(P[i])

    print(ans) def main():
    N, K = map(int,input().split())
    P = list(map(int,input().split()))
    accumP = [0] * (N + 1)
    for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
    idx = 0
    sum = accumP[idx+K] - accumP[idx] 
    for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
    ans = 0
    for i in range(idx, idx+K):
        ans += calc_ex(P[i])

    print(ans) main def calc_ex(P):
    sum = 0
    for p in range(1, P+1):
        sum += p
    return sum / P def calc_ex(P):
    sum = 0
    for p in range(1, P+1):
        sum += p
    return sum / P calc_ex
def calc_ex(P):
    sum = 0
    for p in range(1, P+1):
        sum += p
    return sum / P

def main():
    N, K = map(int,input().split())
    P = list(map(int,input().split()))
    accumP = [0] * (N + 1)
    for i in range(N):
        accumP[i+1] = accumP[i] + P[i]

    # 最大の区間を求める
    idx = 0
    sum = accumP[idx+K] - accumP[idx] 
    for i in range(0, N-K+1):
        if accumP[i+K] - accumP[i] > sum:
            idx = i
            sum = accumP[i+K] - accumP[i]
    
    
    ans = 0
    for i in range(idx, idx+K):
        ans += calc_ex(P[i])

    print(ans)

if __name__ == "__main__":
    main()