import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Data.Array

main :: IO ()
main = do
  [n, x] <- map read . words <$> getLine
  a <- listArray (0, n-1) . map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
  let
    b = array (0, n-1) $ do
      k <- [0..n-1]
      return $ (,) k $ array (0, n-1) $ do
        i <- [0..n-1]
        return $ (,) i $ if k == 0
          then a ! i
          else min ((b ! (k-1)) ! i) (a ! ((i-k)`mod`n))
    ans = flip map [0..n-1] $ \k -> sum (b ! k) + k * x
  print $ minimum ans
