Caravans arrive at the marble forum of Argentium with crates of ledgers, and Notary the chronicler must account for every last one. Task: Bars of heights h[i] stand side by side with width 1. Print the largest rectangle area that fits inside the histogram. Input format: First line: n. Second line: n heights. Output format: Print the maximum area (fits 64-bit). Constraints: 1 <= n <= 4000; 0 <= h[i] <= 10^9.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 4000; 0 <= h[i] <= 10^9.
