Each number is the height of a histogram bar of width 1. Find the area of the largest rectangle that fits inside the histogram.
Input: one line of space-separated heights. Output: the largest area.
Your program reads from stdin and prints to stdout.
Example 1
Input: 2 1 5 6 2 3
Output: 10
Hints