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

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

dp = src[:]

ans = float('inf')

for n in range(N):

    for m in range(N):

       if dp[m] > src[m-n]:

           dp[m] = src[m-n]

    ans = min(ans, sum(dp)+n*X)

print(ans)
N,X = list(map(int,input().split()))

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



ans = sum(A)

costs = A[:]

for i in range(1,N):

    cost = i*X

    if cost >= ans: break

    for j in range(N):

        costs[j] = min(costs[j], A[(j-i)%N])

        cost += costs[j]

    ans = min(ans, cost)



print(ans)
N, X = list(map(int, input().split()))
src = list(map(int, input().split()))
dp = src[:]
ans = float("inf")
for n in range(N):
    for m in range(N):
        if dp[m] > src[m - n]:
            dp[m] = src[m - n]
    ans = min(ans, sum(dp) + n * X)
print(ans)

N, X = list(map(int, input().split()))
A = list(map(int, input().split()))
ans = sum(A)
costs = A[:]
for i in range(1, N):
    cost = i * X
    if cost >= ans:
        break
    for j in range(N):
        costs[j] = min(costs[j], A[(j - i) % N])
        cost += costs[j]
    ans = min(ans, cost)
print(ans)

-src = list(map(int, input().split())) -dp = src[:] -ans = float("inf") -for n in range(N): -    for m in range(N): -        if dp[m] > src[m - n]: -            dp[m] = src[m - n] -    ans = min(ans, sum(dp) + n * X) +A = list(map(int, input().split())) +ans = sum(A) +costs = A[:] +for i in range(1, N): +    cost = i * X +    if cost >= ans: +        break +    for j in range(N): +        costs[j] = min(costs[j], A[(j - i) % N]) +        cost += costs[j] +    ans = min(ans, cost)