#include #define rep(i, a) rep2 (i, 0, a) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define repr(i, a) repr2 (i, 0, a) #define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--) using namespace std; typedef long long ll; const ll inf = 1e18; ll dp[101][20202]; int main() { ll N, V; cin >> N >> V; vector C(N); rep (i, N) cin >> C[i]; partial_sum(C.begin(), C.end(), C.begin()); if (V <= N) { cout << C[N - 1] << endl; return 0; } V -= N; int mini = 0; rep (i, N) { if (C[mini] * (i + 1) > C[i] * (mini + 1)) mini = i; } rep (i, 101) rep (j, 20202) dp[i][j] = inf; dp[0][0] = 0; rep2 (i, 1, N + 1) { rep (j, 20202) { dp[i][j] = dp[i - 1][j]; if (j - i >= 0) { dp[i][j] = min(dp[i][j], dp[i][j - i] + C[i - 1]); } } } ll ans; if (V >= 15151) { ll x = (V - 15151) / (mini + 1); ans = x * C[mini] + dp[N][V - (mini + 1) * x]; } else { ans = dp[N][V]; } ans += C[N - 1]; cout << ans << endl; return 0; }