Language: C++

#include "bits/stdc++.h"
/* Properties of modulo:
	(a/b)%m ,where m is prime  = (a%m) * (b^(m-2))%m
*/
    /*ROLLING HASH
    Rabin-Karp algorithm for pattern matching in a string in O(n) time
    Calculating the number of different substrings of a string in O(n2logn)
    Calculating the number of palindromic substrings in a string.
    */
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define ll long long
#define pb push_back
#define nl cout<<"\n"
#define endl "\n"
#define all(c) (c).begin(),(c).end()
#define trav(a,x) for(auto a = x.begin() ; a != x.end() ; a++)
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
//template<typename T>
//#define o_set(T) tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
// o_set(ll) name ; -- defining ordered set
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : counting from zero it returns the k-th largest or smallest element in the set - returns iterator
bool compare(ll a, ll b){
    return a > b;
}
inline ll max(ll a,ll b)
{return ((a>b)?a:b);}
inline ll min(ll a,ll b)
{return ((a>b)?b:a);}
inline ll gcd(ll a ,ll b)
{if(b==0) return a;a%=b;return gcd(b,a);}
ll power(ll x, ll ex , ll md) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x) % md;
        ex >>= 1ll;
        x = (x * x) % md;
    }
    return ans;
}

vector<ll> c;
int n, X, m, dp[100][100001];
vector<ll> v[100];
int solve(int idx, int val){
    if(idx == n){
        //this is the base case of the recursion, i.e when
        //the value is >= X then only we consider the solution
        //else we reject the solution and pass Infinity
        if(val >= X) return 0;
        else return INF;
    }
    //this is the step where we return the solution if we have calculated it previously
    //when dp[idx][val] == -1, that means that the solution has not been calculated before
    //and we need to calculate it now
    if(dp[idx][val] != -1) return dp[idx][val];

    //this is the step where we do not pick the current element in the knapsack
    int v1 = solve(idx+1, val);

    //this is the step where we add the current element in the knapsack
    int v2 = solve(idx+1, val + value[idx]) + cost[idx];

    //here we are taking the minimum of the above two choices that we made and trying
    //to find the better one, i.e the one which is the minimum
    int ans = min(v1, v2);

    //here we are setting the answer, so that if we find this state again, then we do not calculate
    //it again rather use this solution that we calculated
    dp[idx][val] = ans;

    return dp[idx][val];
}
void solveq(){
    cin >> n >> m >> X;
    vector<ll>c;
    for(ll i = 0 ; i < n ; i++){
        ll a;
        cin >> a;
        c.pb(a);
        for(ll j =0 ; j < m ; j++){
            ll b;
            cin >> b;
            v[j].pb(b);
        }
    }
    int ans =INT_MIN;
        memset(dp, -1, sizeof dp);
    for(ll i = 0 ; i < m ; i++){
        ans = max(ans , solve(0,0));
    }
    cout << ans << endl;
}
int main(){
    IOS;
    ll T=1;
    //cin>>T;
    ll t=0;
    while(t++<T){
        //cout<<"Case #"<<t<<":"<<' ';
        solveq();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:59:21: error: 'INF' was not declared in this scope
   59 |         else return INF;
      |                     ^~~
a.cc:70:33: error: 'value' was not declared in this scope; did you mean 'val'?
   70 |     int v2 = solve(idx+1, val + value[idx]) + cost[idx];
      |                                 ^~~~~
      |                                 val
a.cc:70:47: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   70 |     int v2 = solve(idx+1, val + value[idx]) + cost[idx];
      |                                               ^~~~
      |                                               cosl