def read():

	return [int(i) for i in input().split(" ")]

N, x = read()

A = read()

ans = sum(A)

tempcost = ans

BC = A[:]

for i in range(1, N):

	BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)] 

	tempcost = x * i + sum(BC)

	if(ans > tempcost):

		ans = tempcost

	else:

		break

print(ans)

def read():

	return [int(i) for i in input().split(" ")]

N, x = read()

A = read()

ans = sum(A)

tempcost = ans

BC = A[:]

xt = 0

for i in range(1, N):

	xt += x

	BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)] 

	tempcost = xt + sum(BC)

	if(ans > tempcost):

		ans = tempcost

	else:

		break

print(ans)

def read():
    return [int(i) for i in input().split(" ")]


N, x = read()
A = read()
ans = sum(A)
tempcost = ans
BC = A[:]
for i in range(1, N):
    BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)]
    tempcost = x * i + sum(BC)
    if ans > tempcost:
        ans = tempcost
    else:
        break
print(ans)

def read():
    return [int(i) for i in input().split(" ")]


N, x = read()
A = read()
ans = sum(A)
tempcost = ans
BC = A[:]
xt = 0
for i in range(1, N):
    xt += x
    BC = [BC[j - 1] if BC[j - 1] < BC[j] else BC[j] for j in range(N)]
    tempcost = xt + sum(BC)
    if ans > tempcost:
        ans = tempcost
    else:
        break
print(ans)

+xt = 0 +    xt += x -    tempcost = x * i + sum(BC) +    tempcost = xt + sum(BC)