------
## 最终结论
```python
def largestScore(A, K):
    n = len(A)
    dp = [[0] * (K + 1) for _ in range(n + 1)]
    
    # Initialize the dp array
    for i in range(n + 1):
        for k in range(K + 1):
            dp[i][k] = float('-inf')
    
    dp[0][0] = 0  # Base case: zero elements, zero groups has score of 0

    # Calculate prefix sums
    prefix_sum = [0] * (n + 1)
    for i in range(1, n + 1):
        prefix_sum[i] = prefix_sum[i - 1] + A[i - 1]

    # Fill the dp array
    for k in range(1, K + 1):  # For each number of groups
        for i in range(1, n + 1):  # For each element count
            for j in range(1, i + 1):  # Consider last group starting from j to i
                avg = (prefix_sum[i] - prefix_sum[j - 1]) / (i - j + 1)
                dp[i][k] = max(dp[i][k], dp[j - 1][k - 1] + avg)

    return dp[n][K]

# Example usage:
A = [9,1,2,3,9]
K = 3
print(largestScore(A, K))  # Output: 20.0
```