1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
\n# Code\n\nclass Solution {\npublic:\n    int maxArea(int h, int x, vector<int>& ha, vector<int>& v) {   \n        ha.push_back(h);\n        sort(ha.begin(), h
\n# Code\n```\nclass Solution {\npublic:\n    int maxArea(int h, int x, vector<int>& ha, vector<int>& v) {   \n        ha.push_back(h);\n        sort(ha.begin(), ha.end());\n\t\tint maxh = ha[0];\n        for(int i=1; i<ha.size(); i++){\n            maxh = max(maxh, ha[i] - ha[i-1]);\n        }\n        v.push_back(x);\n        sort(v.begin(), v.end());\n\t\tint maxv = v[0];\n        for(int i=1; i<v.size(); i++){\n            maxv = max(maxv, v[i] - v[i-1]);\n        }\n        return (1LL*maxh*maxv) % 1000000007;\n    }\n};\n```
['C++']