A special event is going to be organized on New Year’s Eve in an IT park having N adjoining buildings.
Being the event organizer, Emma is given the responsibility to display the largest possible
rectangular banner of the event on the adjoining walls of the buildings.
Write an algorithm to help Emma find the largest possible rectangular area of the adjoining walls of
the buildings where the banner can be displayed.
Input
The first line of the input consists of an integer, representing the number of buildings (N).
The second line consists of N space-separated integers representing the heights of N buildings.
Output:
Print an integer representing the largest possible rectangular area of the adjoining walls of the
buildings where the banner can be displayed.
The width of each building is of unit distance. The thickness of the walls between any two buildings is
ignored.
Example:
Input:
5
3 4 7 4 6
Output:
16
solution in python or c or c++.please
Answers
Answered by
1
Answer:
I cannot understand your question
Explanation:
It is so long
Similar questions