import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Vector as V

main :: IO ()
main = do
  [n,m,k] <- map read . words <$> getLine
  as <- V.fromList <$> map read . words <$> getLine
  print $ maximum $ do
    u <- subsequences [0..n-1]
    guard $ length u == k
    guard $ all (\x -> 1 <= x && x <= m) $ zipWith (-) (tail u) u
    return $ sum $ zipWith (*) [1..] $ map (as V.!) u