#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("0"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

// Segment tree (RMQ type)
struct seg {
  typedef ll TT;
  vector<TT> d; int x2;
  seg(){}
  seg(int mx) {
    x2 = 1; while(x2 < mx) x2 <<= 1;
    d.resize(x2<<1,LINF);
  }
  void fil() {
    drep(i,x2) d[i] = min(d[i<<1],d[i<<1|1]);
  }
  void add(int i, TT x=0){
    for(i+=x2,d[i]=x,i>>=1;i;i>>=1) d[i] = min(d[i<<1],d[i<<1|1]); // replace!!
    //for(i+=x2;i;i>>=1) d[i] = max(d[i],x); // update
  }
  TT get(int a, int b, int i=1, int l=0, int r=-1){
    if (r == -1) r = x2;
    if(a <= l && r <= b) return d[i];
    int c = (l+r)>>1;
    TT res = LINF;
    if(a < c) mins(res,get(a,b,i<<1,l,c));
    if(c < b) mins(res,get(a,b,i<<1|1,c,r));
    return res;
  }
};
//

int n;

int main() {
  cin >> n;
  ll x;
  cin >> x;
  vl a(n);
  cin >> a;
  ll ans = LINF;
  seg t(n*2+1);
  rep(j,n) t.d[t.x2+j] = t.d[t.x2+j+n] = a[j];
  t.fil();
  rep(i,n) {
    ll now = x*i;
    // seg t(n+2);
    // t.add(0,a[0]);
    // rrep(j,n-1) {
    //   ll s = t.get(max(0,j-i-1),n+1);
    //   t.add(j,s+a[j]);
    // }
    // now += t.get(max(0,n-i-1),n+1);
    rep(j,n) {
      now += t.get(j,j+i+1);
    }
    mins(ans,now);
  }
  cout<<ans<<endl;
  return 0;
}







Measured memory_bytes: 384