{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"PLAIN","content":"XHK的梦想是有朝一日当上老板,不再给WSJ打工\n现在给他一次做梦的机会,这次他买下了一条GAI(街)\n笔直的GAI上从左到右有n个地基,允许盖起的摩天大楼高度分别为ai\n但是XHK是一个追求美感的女人,哦不是男人,所以他不希望发生这样的情况\nj\u003ci\u003ck 且 hj\u003ehi\u003chk (hi为大楼盖起的实际高度,但是必须小于等于ai)\n与此同时,XHK又希望所有楼的高度尽可能高,那么请你输出一组符合XHK审美并且所有楼高度和最大的一组情况"}},{"title":"Input","value":{"format":"PLAIN","content":"第一行包括一个整数n,表示有n(n≤1000)栋楼\n接下来一行包括n个数,表示i处位置所能建楼的最大高度(ai≤1e9)"}},{"title":"Output","value":{"format":"PLAIN","content":"输出n个数\n表示实际建起的高度和最大并且符合要求的一组楼房方案"}},{"title":"Examples","value":{"format":"PLAIN","content":"输入:\n5\n1 3 5 4 2\n输出:\n1 3 5 4 2\n\n输入:\n6\n5 7 5 6 8 4\n输出:\n5 5 5 6 8 4"}}]}