{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"A histogram is a polygon made up of a series of rectangles that are all aligned at the same base line. The rectangles have similar widths but varied in height. For example, the graphic depicts a histogram made up of rectangles with heights of 2, 1, 4, 5, 1, 3, 3 measured in units and widths of 1.\n\n![Histogram](CDN_BASE_URL/2a2b1d5906a9da442072ba0a840d0588?v\u003d1673804795)\n\nHistograms are often used to illustrate discrete distributions, such as the frequency of letters in text. It is vital to note that the order of the rectangles, i.e. their heights, is important. In addition, compute the size of the greatest rectangle in a histogram that is aligned at the common base line. The picture on the right depicts the histogram\u0027s biggest aligned rectangle."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 20)**, denoting the number of test cases.\n\nEach case contains a line with an integer **N (1 \u0026#8804; N \u0026#8804; 30000)** which indicates the number of rectangles. The next line contains **N** space separated positive integers **(\u0026#8804; 30000)** which indicates the height.\n\n"}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the largest rectangle that can be made."}},{"title":"Sample","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n7\n2 1 4 5 1 3 3\n5\n4 4 3 2 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 8\nCase 2: 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"Dataset is huge; use faster I/O methods."}}]}