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 [int(v) for v in input().split(' ')]



n, x = mygets()

a = mygets()



b1 = a



ans = sum(a)

xt = 0

for i in range(1, n):

    xt += x

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

    bsum = sum(b1) + xt

    if bsum < ans:

        ans = bsum

    else:

        break



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 [int(v) for v in input().split(" ")]


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

-    return [int(v) for v in input().strip().split(" ")] +    return [int(v) for v in input().split(" ")] +xt = 0 -    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 +    xt += x +    b1 = [u if u < b1[k - 1] else b1[k - 1] for k, u in enumerate(a)] +    bsum = sum(b1) + xt +    if bsum < ans: +        ans = bsum +    else: +        break