just do it cpp.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\n    vector<vector<int>> dp;\n    int n ;\npublic:\n\n    int solve(int a ,int b, int k,int n, vector<vector<int>>& stayScore, vector<vector<int>>& travelScore) {\n        if (k == a) {\n            return 0;\n        }\n\n        if (dp[a][b] != -1 ) {\n            return dp[a][b];\n        }\n\n        int res = stayScore[a][b] + solve(a + 1 ,b ,k,n,stayScore,travelScore);\n        for (int i = 0 ; i < n ; i ++) {\n            res = max(res, solve(a + 1,i, k,n ,stayScore,travelScore ) + travelScore[b][i]);\n        }\n\n        dp[a][b] = res;\n        return res;\n\n        \n    }\n    int maxScore(int n, int k, vector<vector<int>>& stayScore, vector<vector<int>>& travelScore) {\n        dp.resize(k + 1, vector<int>(n, -1));\n        \n        int res = 0; \n        for (int i = 0 ; i < n; i ++) {\n            res = max(res, solve(0,i, k,n ,stayScore,travelScore ));\n        }\n        return res;\n    }\n};\n```
[]