n, x = list(map(int, input().split()))

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

blist = alist[:]



ans = None

for i in range(n):

  for j in range(n):

    blist[j] = min(blist[j], alist[j-i])

  if ans is None:

    ans = i * x + sum(blist)

  else:

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

print(ans)

def main():

    n, x = list(map(int, input().split()))

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

    ans = 1100100100100100100

    mina = [10000000000 for i in range(n)]

    for i in range(n):

        for j in range(n):

            mina[j] = min(mina[j], a[i - j])

        sumb = sum(mina)

        ans = min(ans, sumb + i * x)

    print(ans)





if __name__ == '__main__':

    main()

n, x = list(map(int, input().split()))
alist = list(map(int, input().split()))
blist = alist[:]
ans = None
for i in range(n):
    for j in range(n):
        blist[j] = min(blist[j], alist[j - i])
    if ans is None:
        ans = i * x + sum(blist)
    else:
        ans = min(ans, i * x + sum(blist))
print(ans)

def main():
    n, x = list(map(int, input().split()))
    a = list(map(int, input().split()))
    ans = 1100100100100100100
    mina = [10000000000 for i in range(n)]
    for i in range(n):
        for j in range(n):
            mina[j] = min(mina[j], a[i - j])
        sumb = sum(mina)
        ans = min(ans, sumb + i * x)
    print(ans)


if __name__ == "__main__":
    main()

-n, x = list(map(int, input().split())) -alist = list(map(int, input().split())) -blist = alist[:] -ans = None -for i in range(n): -    for j in range(n): -        blist[j] = min(blist[j], alist[j - i]) -    if ans is None: -        ans = i * x + sum(blist) -    else: -        ans = min(ans, i * x + sum(blist)) -print(ans) +def main(): +    n, x = list(map(int, input().split())) +    a = list(map(int, input().split())) +    ans = 1100100100100100100 +    mina = [10000000000 for i in range(n)] +    for i in range(n): +        for j in range(n): +            mina[j] = min(mina[j], a[i - j]) +        sumb = sum(mina) +        ans = min(ans, sumb + i * x) +    print(ans) + + +if __name__ == "__main__": +    main()