[C++] Divide into Increasing/Decreasing Intervals
\nclass Solution {\npublic:\n    long long minimumMoney(vector<vector<int>>& t) {\n        long long cur = 0, result = 0;\n        vector<vector<int>> inc, dec;
```\nclass Solution {\npublic:\n    long long minimumMoney(vector<vector<int>>& t) {\n        long long cur = 0, result = 0;\n        vector<vector<int>> inc, dec;\n        for(auto& a: t){\n            if(a[0] > a[1])\n                dec.push_back(a);\n            else\n                inc.push_back(a);\n        }\n        sort(dec.begin(), dec.end(), [](vector<int>& a, vector<int>& b){\n            return b[1] > a[1];\n        });\n        sort(inc.begin(), inc.end(), [](vector<int>& a, vector<int>& b){\n            return a[0] > b[0];\n        });\n        for(auto& a: dec){\n            cur -= a[0];\n            result = min(result, cur);\n            cur += a[1];\n        }\n        for(auto& a: inc){\n            cur -= a[0];\n            result = min(result, cur);\n            cur += a[1];\n        }\n        return abs(result);\n    }\n};\n```
['Greedy', 'C', 'Sorting', 'C++']