#include <stdio.h>

int N; long long X,A[2020],U[2020];

int main()
{
	scanf ("%d %lld",&N,&X);
	for (int i=0;i<N;i++) scanf ("%lld",&A[i]);
	long long ans = 0;
	for (int i=0;i<N;i++) ans += A[i], U[i] = A[i];
	for (int i=1;i<N;i++){
		long long now = i * X;
		for (int j=0;j<N;j++){
			int k = (j + N - i) % N;
			if (U[j] > A[k])
				U[j] = A[k];
			now += U[j];
		}
		if (ans > now)
			ans = now;
	}
	printf ("%lld\n",ans);

	return 0;
}