import numpy as np

from copy import deepcopy





N, x = list(map(int,input().split()))

A = list(map(int,input().split()))



def myfunc(N, x, A):

  B = deepcopy(np.array(A))

  m = sum(B)

  def apppop(A):

    A.append(A[0])

    A.pop(0)

  for idx in range(1,N):

    apppop(A)

    np.fmin(B, A, out=B)

    m = min(np.sum(B)+idx*x, m)

  print(int(m))



myfunc(N, x, A)
import numpy as np

from copy import deepcopy



N, x = list(map(int,input().split()))

A = list(map(int,input().split()))



def myfunc(N, x, A):

  A = np.array(A)

  B = deepcopy(A)

  m = sum(B)

  for idx in range(1,N):

    A = np.append(A, A[0])

    A = np.delete(A, 0)

    np.fmin(B, A, out=B)

    m = min(np.sum(B)+idx*x, m)

  print(int(m))



myfunc(N, x, A)
import numpy as np
from copy import deepcopy

N, x = list(map(int, input().split()))
A = list(map(int, input().split()))


def myfunc(N, x, A):
    B = deepcopy(np.array(A))
    m = sum(B)

    def apppop(A):
        A.append(A[0])
        A.pop(0)

    for idx in range(1, N):
        apppop(A)
        np.fmin(B, A, out=B)
        m = min(np.sum(B) + idx * x, m)
    print(int(m))


myfunc(N, x, A)

import numpy as np
from copy import deepcopy

N, x = list(map(int, input().split()))
A = list(map(int, input().split()))


def myfunc(N, x, A):
    A = np.array(A)
    B = deepcopy(A)
    m = sum(B)
    for idx in range(1, N):
        A = np.append(A, A[0])
        A = np.delete(A, 0)
        np.fmin(B, A, out=B)
        m = min(np.sum(B) + idx * x, m)
    print(int(m))


myfunc(N, x, A)

-    B = deepcopy(np.array(A)) +    A = np.array(A) +    B = deepcopy(A) - -    def apppop(A): -        A.append(A[0]) -        A.pop(0) - -        apppop(A) +        A = np.append(A, A[0]) +        A = np.delete(A, 0)