Idk - I'm just a Chill Guy 
Code
# Code
```cpp []
class Solution{
public:
    int DP[500][500][3];

    int getmaxProfit(int R , int C , int T , vector<vector<int>> &A){
        if(R == 0 && C == 0) return T ? max(0 , A[R][C]) : A[R][C];

        if(DP[R][C][T] != -8e8) return DP[R][C][T];

        int ans = -8e8;

        for(int D : {0 , -1}){
            int NR = R + D;
            int NC = C - 1 - D;
            if(min(NR , NC) >= 0){
                ans = max(ans , A[R][C] + getmaxProfit(NR , NC , T , A));
                if(T > 0 && A[R][C] < 0) ans = max(ans , getmaxProfit(NR , NC , T - 1 , A));
            }
        }

        return DP[R][C][T] = ans;
    }

    int maximumAmount(vector<vector<int>> &A){
        int N = A.size() , M = A[0].size();

        for(int R = 0 ; R < N ; R++)
            for(int C = 0 ; C < M ; C++)
                DP[R][C][0] = DP[R][C][1] = DP[R][C][2] = -8e8;

        return getmaxProfit(N - 1 , M - 1 , 2 , A);
    }
};
```
['C++']