[Java] N(log N) solution
\nclass Solution {\n    public int maxArea(int h, int w, int[] horizontalCuts, int[] verticalCuts) {\n        Arrays.sort(horizontalCuts);\n        Arrays.sort(
```\nclass Solution {\n    public int maxArea(int h, int w, int[] horizontalCuts, int[] verticalCuts) {\n        Arrays.sort(horizontalCuts);\n        Arrays.sort(verticalCuts);\n        \n        long maxY = horizontalCuts.length>0? Math.max(horizontalCuts[0],h-horizontalCuts[horizontalCuts.length-1]) : h;\n        long maxX = verticalCuts.length>0? Math.max(verticalCuts[0],w-verticalCuts[verticalCuts.length-1]) : w;\n        \n        for (int i=1;i<horizontalCuts.length;i++) \n        {\n            maxY=Math.max(maxY, horizontalCuts[i]-horizontalCuts[i-1]);\n        }\n        for (int i=1;i<verticalCuts.length;i++) \n        {\n            maxX=Math.max(maxX, verticalCuts[i]-verticalCuts[i-1]);\n        }\n       \n        return (int)((maxX*maxY)%1000000007);\n    }\n}\n```
[]