Simple Recursive Solution
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:O(n^2 x k)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n xk )\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int n,k;\n    vector<vector<int>>stay;\n    vector<vector<int>>travel;\n    vector<vector<int>> dp;\n    int f(int city,int day){\n        if (day == k) return 0;\n        if (dp[city][day] != -1) return dp[city][day];\n        int ruko =stay[day][city] + f(city,day+1);\n        int bhago =0;\n        for (int i=0;i<n;i++){\n            if (i == city) continue;\n            bhago =max(bhago,f(i,day+1)+travel[city][i]);\n        }\n        return dp[city][day] = max(ruko,bhago);\n    }\n    int maxScore(int nn, int kk, vector<vector<int>>& stayScore, vector<vector<int>>& travelScore) {\n        k=kk;\n        n=nn;\n        stay =stayScore;\n        travel =travelScore;\n        dp.resize(n,vector<int>(k,-1));\n        int ans =0;\n        for (int i=0;i<n;i++){\n            ans =max(ans,f(i,0));\n        }\n        return ans;\n    }\n};\n```
[]