Company: Ibm_1aug
Difficulty: medium
Largest Billboard Problem Description You are given a row of buildings , all standing next to each other in a straight line. Each building has a width of 1 unit and a given height . You want to install a rectangular advertisement billboard that spans one or more consecutive buildings . The billboard must rest on the buildings it covers, so its height cannot exceed the height of the shortest building in the range it covers. A billboard covering k consecutive buildings therefore has width k and height equal to the smallest height among those k buildings, giving an area of k times that smallest height. Find the largest possible area of a billboard that can be installed. Input Format The first line contains a single integer n , the number of buildings. Each of the next n lines contains a single integer, the height of one building, given from left to right. Output Format Print a single integer: the maximum area of a billboard that can be installed, followed by a newline. Constraints 1 <=