func_code_string: #include <bits/stdc++.h>   using namespace std;   int N, K, S;   int q[153];   vector<vector<int> > prev_, next_;   const int INF = 1e9;   int main() {     scanf( %d%d%d , &N, &K, &S);     S = min(S, N * (N - 1) / 2);     for (int i = 1; i <= N; i++) scanf( %d , &q[i]);     prev_ = vector<vector<int> >(K + 1, vector<int>(S + 1, INF));     prev_[0][0] = 0;     for (int i = 1; i <= N; i++) {       next_ = prev_;       for (int j = 1; j <= min(K, i); j++)         for (int k = 0; k <= S; k++) {           if (k + abs(i - j) <= S)             next_[j][k + abs(i - j)] =                 min(next_[j][k + abs(i - j)], prev_[j - 1][k] + q[i]);         }       swap(prev_, next_);     }     int ans = INF;     for (int i = 0; i <= S; i++) ans = min(ans, prev_[K][i]);     printf( %d n , ans);     return 0;   }   