{"trustable":true,"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":"HTML","content":"\u003cp\u003e有一条宽度为$$$n$$$的河流。河流的左岸是第$$$0$$$个单元格,右岸是第$$$n + 1$$$个单元格(更正式地说,河流可以表示为从$$$0$$$到$$$n + 1$$$编号的$$$n + 2$$$个单元格序列)。河流上还有$$$m$$$个木平台,第$$$i$$$个平台的长度为$$$c_i$$$(因此第$$$i$$$个平台占据了河流的$$$c_i$$$个连续单元格)。保证平台长度之和不超过$$$n$$$。\u003c/p\u003e\u003cp\u003e你站在$$$0$$$处,想要以某种方式到达$$$n+1$$$。如果你站在位置$$$x$$$,你可以跳到范围在$$$[x + 1; x + d]$$$内的任何位置。\u003cspan class\u003d\"tex-font-style-bf\"\u003e然而\u003c/span\u003e你并不喜欢水,所以你只能跳到属于某个木平台的单元格。例如,如果$$$d\u003d1$$$,你只能跳到下一个位置(如果它属于木平台)。\u003cspan class\u003d\"tex-font-style-bf\"\u003e你可以假设单元格$$$0$$$和$$$n+1$$$属于木平台\u003c/span\u003e。\u003c/p\u003e\u003cp\u003e你想知道是否可以从$$$0$$$到达$$$n+1$$$,如果你可以任意向左或向右移动平台任意次数(可能为零),只要它们不相交(但两个平台可以相邻)。这也意味着你不能改变平台的相对顺序。\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003e请注意,你应该移动平台直到开始跳跃\u003c/span\u003e(换句话说,你先移动平台,然后开始跳跃)。\u003c/p\u003e\u003cp\u003e例如,如果$$$n\u003d7$$$,$$$m\u003d3$$$,$$$d\u003d2$$$和$$$c \u003d [1, 2, 1]$$$,那么从$$$0$$$到达$$$8$$$的一种方式如下:\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/4c010fd06eb422c2ca6892e103fda29c?v\u003d1714577472\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003cspan class\u003d\"tex-font-size-small\"\u003e第一个例子:$$$n\u003d7$$$。\u003c/span\u003e \u003c/center\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含三个整数$$$n$$$,$$$m$$$和$$$d$$$($$$1 \\le n, m, d \\le 1000, m \\le n$$$)— 河流的宽度,平台数量和你的最大跳跃距离,分别。\u003c/p\u003e\u003cp\u003e输入的第二行包含$$$m$$$个整数$$$c_1, c_2, \\dots, c_m$$$($$$1 \\le c_i \\le n, \\sum\\limits_{i\u003d1}^{m} c_i \\le n$$$),其中$$$c_i$$$是第$$$i$$$个平台的长度。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e如果无法从$$$0$$$到达$$$n+1$$$,则在第一行打印\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e。否则,在第一行打印\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e,在第二行打印长度为$$$n$$$的数组$$$a$$$ — 河流单元格的序列(不包括单元格$$$0$$$和$$$n + 1$$$)。\u003c/p\u003e\u003cp\u003e如果单元格$$$i$$$不属于任何平台,则$$$a_i$$$应为$$$0$$$。否则,它应等于单元格$$$i$$$所属平台的索引(从$$$1$$$到$$$m$$$按输入顺序编号的平台)。\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003e请注意\u003c/span\u003e,所有$$$a_i$$$等于$$$1$$$的单元格应构成长度为$$$c_1$$$的数组$$$a$$$的连续子段,所有$$$a_i$$$等于$$$2$$$的单元格应构成长度为$$$c_2$$$的数组$$$a$$$的连续子段,...,所有$$$a_i$$$等于$$$m$$$的单元格应构成长度为$$$c_m$$$的数组$$$a$$$的连续子段。在$$$a$$$中$$$2$$$的最左位置应大于$$$1$$$的最右位置,在$$$a$$$中$$$3$$$的最左位置应大于$$$2$$$的最右位置,...,在$$$a$$$中$$$m$$$的最左位置应大于$$$m-1$$$的最右位置。\u003c/p\u003e\u003cp\u003e查看示例输出以更好理解。\u003c/p\u003e"}},{"title":"示例","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 3 2\n1 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n0 1 0 2 2 0 3 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"","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\u003e10 1 11\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n0 0 0 0 0 0 0 0 0 1 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"","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\u003e10 1 5\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n0 0 0 0 1 1 0 0 0 0 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e考虑第一个例子:答案是$$$[0, 1, 0, 2, 2, 0, 3]$$$。你执行的跳跃序列是$$$0 \\rightarrow 2 \\rightarrow 4 \\rightarrow 5 \\rightarrow 7 \\rightarrow 8$$$。\u003c/p\u003e\u003cp\u003e考虑第二个例子:放置平台的方式并不重要,因为你总是可以从$$$0$$$跳到$$$11$$$。\u003c/p\u003e\u003cp\u003e考虑第三个例子:答案是$$$[0, 0, 0, 0, 1, 1, 0, 0, 0, 0]$$$。你执行的跳跃序列是$$$0 \\rightarrow 5 \\rightarrow 6 \\rightarrow 11$$$。\u003c/p\u003e"}}]}