import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

void main ()
{
	int n, x;
	while (readf (" %s %s", &n, &x) > 0)
	{
		readln;
		auto a = readln.split.map !(to !(long)).array;
		a ~= a;
		auto b = a.dup;
		long res = long.max;
		foreach (i; 0..n)
		{
			res = min (res, x * 1L * i + sum (b[n..n * 2]));
			foreach (j; n..n * 2)
			{
				b[j] = min (b[j], a[j - i - 1]);
			}
		}
		writeln (res);
	}
}
