local mmi, mma = math.min, math.max
local n, x = io.read("*n", "*n")
local a = {}
local t = {}
for i = 1, n do
  a[i] = io.read("*n")
  t[i] = {a[i]}
end
for i = 1, n do
  local ti = t[i]
  for j = 1, n - 1 do
    local use = i - j
    if use <= 0 then use = use + n end
    ti[j + 1] = mmi(ti[j], a[use])
  end
end
local ret = 0
for i = 1, n do
  ret = ret + t[i][1]
end
for j = 2, n do
  local v = 0
  for i = 1, n do
    v = v + t[i][j]
  end
  ret = mmi(ret, x * (j - 1) + v)
end
print(ret)
