func_code_string: #include <bits/stdc++.h>   using namespace std;   struct com {     int l, r;     long long c;     friend bool operator<(const com &a, const com &b) { return a.r < b.r; }   } a[100010];   int n, m, K;   long long cost[310][310], dp[310][310];   const long long inf = 0x3F3F3F3F3F3F3F3FLL;   int main() {     scanf( %d%d%d , &n, &m, &K);     memset(cost, 0x3F, sizeof(cost));     for (int i = 0; i < m; i++)       scanf( %d%d%I64d , &a[i].l, &a[i].r, &a[i].c),           cost[a[i].l][a[i].r] = min(cost[a[i].l][a[i].r], a[i].c);     for (int l = n; l >= 1; l--) {       for (int i = 1; i + l - 1 <= n; i++) {         int st = i, ed = i + l - 1;         if (st > 1) cost[st][ed] = min(cost[st][ed], cost[st - 1][ed]);         if (ed < n) cost[st][ed] = min(cost[st][ed], cost[st][ed + 1]);       }     }     memset(dp, 0x3F, sizeof(dp));     dp[0][0] = 0;     for (int i = 1; i <= n; i++)       for (int j = 0; j <= i; j++) {         dp[i][j] = min(dp[i][j], dp[i - 1][j]);         for (int k = 0; k <= j; k++)           dp[i][j] = min(dp[i - k][j - k] + cost[i - k + 1][i], dp[i][j]);       }     if (dp[n][K] == inf)       cout << -1 << endl;     else       cout << dp[n][K] << endl;     return 0;   }   