func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename T, typename T1>   ostream &operator<<(ostream &out, pair<T, T1> obj) {     out <<  (  << obj.first <<  ,  << obj.second <<  ) ;     return out;   }   template <typename T, typename T1>   ostream &operator<<(ostream &out, map<T, T1> cont) {     typename map<T, T1>::const_iterator itr = cont.begin();     typename map<T, T1>::const_iterator ends = cont.end();     for (; itr != ends; ++itr) out << *itr <<    ;     out << endl;     return out;   }   template <typename T>   ostream &operator<<(ostream &out, set<T> cont) {     typename set<T>::const_iterator itr = cont.begin();     typename set<T>::const_iterator ends = cont.end();     for (; itr != ends; ++itr) out << *itr <<    ;     out << endl;     return out;   }   template <typename T>   ostream &operator<<(ostream &out, multiset<T> cont) {     typename multiset<T>::const_iterator itr = cont.begin();     typename multiset<T>::const_iterator ends = cont.end();     for (; itr != ends; ++itr) out << *itr <<    ;     out << endl;     return out;   }   template <typename T,             template <typename ELEM, typename ALLOC = allocator<ELEM>> class CONT>   ostream &operator<<(ostream &out, CONT<T> cont) {     typename CONT<T>::const_iterator itr = cont.begin();     typename CONT<T>::const_iterator ends = cont.end();     for (; itr != ends; ++itr) out << *itr <<    ;     out << endl;     return out;   }   template <typename T, unsigned int N, typename CTy, typename CTr>   typename enable_if<!is_same<T, char>::value, basic_ostream<CTy, CTr> &>::type   operator<<(basic_ostream<CTy, CTr> &out, const T (&arr)[N]) {     for (auto i = 0; i < N; ++i) out << arr[i] <<    ;     out << endl;     return out;   }   template <typename T>   T gcd(T a, T b) {     T min_v = min(a, b);     T max_v = max(a, b);     while (min_v) {       T temp = max_v % min_v;       max_v = min_v;       min_v = temp;     }     return max_v;   }   template <typename T>   T lcm(T a, T b) {     return (a * b) / gcd(a, b);   }   template <typename T>   T fast_exp_pow(T base, T exp, T mod) {     long long res = 1;     while (exp) {       if (exp & 1) {         res *= base;         res %= mod;       }       exp >>= 1;       base *= base;       base %= mod;     }     return res % mod;   }   int N, M, K, L, R;   long long C, answer = 99999999999999LL;   long long dp_solve[310][310];   long long min_cost[310][310];   int main() {     scanf( %d%d%d , &N, &M, &K);     for (auto i = 0; i < 310; ++i)       for (auto j = 0; j < 310; ++j)         dp_solve[i][j] = min_cost[i][j] = 99999999999999LL;     for (auto i = 0; i < M; ++i) {       scanf( %d%d%lld , &L, &R, &C);       min_cost[L][R] = min(min_cost[L][R], C);     }     for (auto r = 1; r <= N; ++r)       for (auto l = 1; l <= r; ++l)         min_cost[l][r] = min(min_cost[l][r], min_cost[l - 1][r]);     for (int l = N; l >= 1; --l)       for (int r = N; r >= l; --r)         min_cost[l][r] = min(min_cost[l][r], min_cost[l][r + 1]);     for (auto i = 0; i <= N; ++i) {       dp_solve[i][0] = 0;       for (auto j = 0; j <= i; ++j) {         if (dp_solve[i][j] == 99999999999999LL) continue;         dp_solve[i + 1][j] = min(dp_solve[i + 1][j], dp_solve[i][j]);         for (auto k = i + 1; k <= N; ++k)           dp_solve[k][j + (k - i)] =               min(dp_solve[k][j + (k - i)], dp_solve[i][j] + min_cost[i + 1][k]);       }     }     answer = dp_solve[N][K];     if (answer >= 99999999999999LL) answer = -1;     printf( %lld n , answer);     return 0;   }   