Home => ProblemSet => 3.3-19:最大矩形面积
Problem1989--3.3-19:最大矩形面积

1989: 3.3-19:最大矩形面积

Time Limit: 1 Sec  Memory Limit: 128 MB  Submit: 0  Solved: 0
[ Submit ] [ Status ] [ Creator: ][ 参考程序 ]

Description

给出一张柱状图,每根柱子的宽度为1,高度为hi,现在请你求出柱状图中最大矩形的面积。

Input

第一行一个正整数n,表示柱子的个数 (n<=105)
第二行n个非负整数,hi表示第 i 个柱子的高度 (hi <= 109)

Output

最大矩形面积

Sample Input Copy

11
5 3 4 2 6 5 0 7 3 4 4

Sample Output Copy

12

HINT

n <= 105
hi <= 109

Source/Category