The council of the singing sands of Echo Dunes pays by the answer, and Ulrica intends to earn it. First: the full register of signals. 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.
