solve Maximal Rectangle in dp(O(n^3))