import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import Data.Array.Unboxed
import Data.Array.IO

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

  m <- newArray ((0,0),(n-1,n-1)) 0 :: IO (IOUArray (Int,Int) Int)

  forM_ [0..n-1] $ \i -> writeArray m (i,0) (as!i)
  forM_ [1..n-1] $ \k -> do
    forM_ [0..n-1] $ \i -> do
      writeArray m (i,k) =<< min (as!((i-k+n)`mod`n)) <$> readArray m (i,k-1)
        
  print =<< minimum <$> (forM [0..n-1] $ \k -> (+k*x) . sum <$> (forM [0..n-1] $ \i -> readArray m (i,k)))
