#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAXN 2000
#define LL long long
#define INF 10000000000000000
int n;
LL a[MAXN+5],x;
LL S;
LL ans;
int main()
{
	ans=INF;
	scanf("%d%lld",&n,&x);
	for(int i=0;i<n;i++)
	{scanf("%lld",&a[i]);S+=a[i];}
	for(int st=0;st<n;st++)
	{
		LL sum=-1,s=0;
		for(int j=0;j<=n-1;j++)
		{
			sum++;s+=a[(st+j)%n];
			ans=min(ans,a[st]*(j+1)+x*sum+S-s);
		}
	}
	printf("%lld",ans);
}