import java.util.Scanner

fun main(args: Array<String>){
  val scn = Scanner(System.`in`) //Scannerのインスタンスを作成
  val n: Long = scn.nextLong()//Int型に変換
  val x: Long = scn.nextLong()
  
  val a: MutableList<Long>  = mutableListOf()
  
  var count: Long = n
  while(0 < count--) {
    val t: Long = scn.nextLong()
    a.add(t)
  }

  var memo = Array<Array<Long>>(n.toInt(), {i -> Array<Long>(n.toInt(), { j-> 0 }) })
  
  var id: Long = n
  while(0 < id--) {
    var i: Long = n - id - 1
    var rec: Long = -1
    var jd: Long = n
    while(0 < jd--) {
      var j: Long = n - jd - 1
      var k: Long = (n + i - j) % n
      if (rec < 0 || a[k.toInt()] < rec) {
        rec = a[k.toInt()]
      }
      memo[i.toInt()][j.toInt()] = rec
    }
  }
    
  var record: Long = -1
  
  var jd: Long = n
  while(0 < jd--) {
    var j: Long = n - jd - 1
    var temp: Long = x * j
    
    var id: Long = n
    while(0 < id--) {
      var i: Long = n - id - 1
      temp = temp + memo[i.toInt()][j.toInt()]
    }
    if ( record < 0 || temp < record) {
      record = temp
    }
  }
  
  println(record)
}