transfer to the largest rectangle in histogram problem