def mygets():

    return list(map(int, input().strip().split(' ')))



n, x = mygets()

a = mygets()



b1 = a



ans = sum(a)



def f(k, u):

    j = k - 1

    if j < 0:

        j = n - 1

    w = b1[j]

    if u < w:

        return u

    return w



for i in range(1, n):

    b2 = [f(k, u) for k, u in enumerate(a)]

    ans = min(ans, sum(b2) + i * x)

    b1 = b2



print(ans)
def mygets():

    return [int(v) for v in input().strip().split(' ')]



n, x = mygets()

a = mygets()



b1 = a



ans = sum(a)



for i in range(1, n):

    b2 = [u if u < b1[k - 1] else b1[k - 1] for k, u in enumerate(a)]

    ans = min(ans, sum(b2) + i * x)

    b1 = b2



print(ans)
def mygets():
    return list(map(int, input().strip().split(" ")))


n, x = mygets()
a = mygets()
b1 = a
ans = sum(a)


def f(k, u):
    j = k - 1
    if j < 0:
        j = n - 1
    w = b1[j]
    if u < w:
        return u
    return w


for i in range(1, n):
    b2 = [f(k, u) for k, u in enumerate(a)]
    ans = min(ans, sum(b2) + i * x)
    b1 = b2
print(ans)

def mygets():
    return [int(v) for v in input().strip().split(" ")]


n, x = mygets()
a = mygets()
b1 = a
ans = sum(a)
for i in range(1, n):
    b2 = [u if u < b1[k - 1] else b1[k - 1] for k, u in enumerate(a)]
    ans = min(ans, sum(b2) + i * x)
    b1 = b2
print(ans)

-    return list(map(int, input().strip().split(" "))) +    return [int(v) for v in input().strip().split(" ")] - - -def f(k, u): -    j = k - 1 -    if j < 0: -        j = n - 1 -    w = b1[j] -    if u < w: -        return u -    return w - - -    b2 = [f(k, u) for k, u in enumerate(a)] +    b2 = [u if u < b1[k - 1] else b1[k - 1] for k, u in enumerate(a)]