n, x = [int(i) for i in input().split()]

A = [int(i) for i in input().split()]



B = A[:]

ans = sum(A)



for i in range(1, n):

    for j in range(n):

        B[j] = min(B[j], A[j-i])

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



print(ans)
n, x = [int(i) for i in input().split()]

A = [int(i) for i in input().split()]



B = A[:]

ans = sum(A)



for i in range(1, n):

    B = [min(B[j], A[j-i]) for j in range(n)]

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



print(ans)
n, x = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = A[:]
ans = sum(A)
for i in range(1, n):
    for j in range(n):
        B[j] = min(B[j], A[j - i])
    ans = min(ans, sum(B) + i * x)
print(ans)

n, x = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = A[:]
ans = sum(A)
for i in range(1, n):
    B = [min(B[j], A[j - i]) for j in range(n)]
    ans = min(ans, sum(B) + i * x)
print(ans)

-    for j in range(n): -        B[j] = min(B[j], A[j - i]) +    B = [min(B[j], A[j - i]) for j in range(n)]