Give a O(n^2) DP solution to maximal_rectangle.