Medium Accuracy: 49.97% Submissions: 41067 Points: 4
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity, assume that all bars have same width and the width is 1 unit.
The first line contains an integer 'T' denoting the total number of test cases. T test-cases follow. In each test cases, the first line contains an integer 'N' denoting the size of array. The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of the array. The elements of the array represents the height of the bars.
For each test-case, in a separateline, the maximum rectangular area possible from the contiguous bars.
1 <= T <= 100
1 <= N <= 105 1 <= A[i] <= 104