{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n \u003cp\u003eA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rectangles with the heights 2, 1, 4, 5, 1, 3, 3, measured in units where 1 is the width of the rectangles:\u003c/p\u003e\n \u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/7ad3bdb3b3fc992a9cbb171beb79abfa?v\u003d1676908104\"\u003e\n \u003c/center\u003e\n \u003cp\u003eUsually, histograms are used to represent discrete distributions, e.g., the frequencies of characters in texts. Note that the order of the rectangles, i.e., their heights, is important. Calculate the area of the largest rectangle in a histogram that is aligned at the common base line, too. The figure on the right shows the largest aligned rectangle for the depicted histogram.\u003c/p\u003e\n\n"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eStarts with an integer \u003ccode\u003en\u003c/code\u003e, denoting the number of rectangles it is composed of. You may assume that \u003ccode\u003e1 \u0026lt;\u003d n \u0026lt;\u003d 10000\u003c/code\u003e. \u003c/p\u003e\n\n\u003cp\u003eThen follow \u003ccode\u003en\u003c/code\u003e integers \u003ccode\u003eh\u003csub\u003e1\u003c/sub\u003e, ..., h\u003csub\u003en\u003c/sub\u003e\u003c/code\u003e, where \u003ccode\u003e0 \u0026lt;\u003d h\u003csub\u003ei\u003c/sub\u003e \u0026lt;\u003d 100000\u003c/code\u003e. These numbers denote the heights of the rectangles of the histogram in left-to-right order. The width of each rectangle is \u003ccode\u003e1\u003c/code\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput on a single line the area of the largest rectangle in the specified histogram. Remember that this rectangle must be aligned at the common base line.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","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\u003e7 \n2 1 4 5 1 3 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Sample 2","value":{"format":"HTML","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\u003e4 \n1000 1000 1000 1000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4000\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}