#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll n,v; cin>>n>>v; vector c(n); for(int i = 0;i>c[i]; ll sum = 0; for(int i = 0;i a(n+1,0); for(int i = 0;i dp(n+1,1e18); dp[0] = 0; for(int i = 0;i<=n;i++){ for(int j = 1;j<=n;j++){ if(i+j>n) continue; dp[i+j] = min(dp[i+j],dp[i]+a[j]); } } for(int i = 0;i=0) now += dp[nv]; ans = min(ans,now); } cout<