{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n \n\n直方图是由在共同基线上排列的矩形序列组成的多边形。矩形具有相等的宽度,但可以具有不同的高度。例如,左边的图显示了由高度为2, 1, 4、5, 1, 3、3的矩形组成的直方图,其中单位为矩形的宽度为1: \n \u003cbr\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/eb5960f09a1245ebe970bb7af6446b63?v\u003d1523793475\" SRC\u003d\"CDN_BASE_URL/eb5960f09a1245ebe970bb7af6446b63?v\u003d1523793475\"\u003e \n \u003cbr\u003e通常,直方图用于表示离散分布,例如文本中字符的频率。请注意,矩形的顺序,即它们的高度,是重要的。在直方图中计算最大矩形的面积,该直方图也是在公共基线上对齐的。右边的图形显示了直方图中最大的对齐矩形。\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" 多组测试数据 每组测试数据的第一行为n(1 \u003c\u003d n \u003c\u003d 100000), 表示图形有n个小矩形构成. 接下来一行输入n个整数h1, h2...hn (0 \u003c\u003d hi \u003c\u003d 1000000000, 1 \u003c\u003d i \u003c\u003d n), 表示每个小矩形的高度\n n为0时程序结束"}},{"title":"Output","value":{"format":"HTML","content":"仅输出一行表示面积的最大值"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\n7 2 1 4 5 1 3 3\n4 1000 1000 1000 1000\n0\u003c/pre\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\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\u003e8\n4000\u003c/pre\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}