#include int N; long long V,C[101],D[1001]; int main() { scanf ("%d %lld",&N,&V); for (int i=1;i<=N;i++) scanf ("%lld",&C[i]), C[i] += C[i-1]; int x = 1; for (int i=2;i<=N;i++) if (C[x] * i > C[i] * x) x = i; for (int i=1;i<=1000;i++){ D[i] = 1e18; for (int j=1;j<=N;j++) if (i >= j){ if (D[i] > D[i-j] + C[j]) D[i] = D[i-j] + C[j]; } } long long ans = 1e18; V -= N; if (V < 0) ans = C[N]; for (int i=0;i<=1000;i++) if (i <= V){ int r = (V - i + x - 1) / x; long long w = C[N] + D[i] + C[x] * r; if (ans > w) ans = w; } printf ("%lld\n",ans); return 0; }