from typing import Sequence


def solve(N: int, M: int, a: Sequence) -> float:
    dis = [[0.0 for _ in range(N + 1)] for _ in range(N + 1)]
    for i in range(N):
        s = 0
        for j in range(i + 1, N + 1):
            s += a[j - 1]
            dis[i][j] = s / (j - i)
    dp = [[0.0 for _ in range(M + 1)] for _ in range(N + 1)]
    for i in range(N + 1):
        for j in range(i):
            for k in range(M):
                dp[i][k + 1] = max(dp[i][k + 1], dp[j][k] + dis[j][i])
    return max(dp[N])


n, m = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, m, a))
