using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zad4
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] q = Console.ReadLine().Split();
            int N = int.Parse(q[0]);
            int k = int.Parse(q[1]);
            double[] A = new double[N];
            string[] w = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
                A[i] = double.Parse(w[i]);
            double rezultat = 0;
            if (k == 0)
            {
                for (int j = 0; j < N; j++)
                {
                    rezultat += A[j];
                }
            }
            else
            {
                for (int r = 0; r <= k; r++)
                {
                    for (int i = 0; i < N; i++)
                    {
                        for (int j = i; j <= N; j++)
                        {
                            rezultat += A[i];
                        }
                    }
                }
            }
            rezultat -= A[0];
            Console.WriteLine(rezultat);
        }
    }
}