import Control.Applicative
import Data.List
import Data.Maybe
import Data.Array

main = do
  [n,x] <- map read . words <$> getLine :: IO [Int]
  as <- listArray (0,n-1) . map read . words <$> getLine :: IO (Array Int Int)

  let m = array ((0,0),(n-1,n-1)) $
        [((i,0),as!i) | i <- [0..n-1]] ++
        [((i,k), min (m!(i,k-1)) (as!((i-k+n)`mod`n))) | k <- [1..n-1], i <- [0..n-1]]

  --print $ m
        
  print $ minimum [sum [m!(i,k) | i <- [0..n-1]] + k*x | k <- [0..n-1]]
  
