{"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\u003eMocha居住的城市名叫芝江。这个城市有$$$n+1$$$个村庄和$$$2n-1$$$条有向道路。\u003c/p\u003e\u003cp\u003e这里有两种道路:\u003c/p\u003e\u003cul\u003e\u003cli\u003e$$$n-1$$$条道路从村庄$$$i$$$通往村庄$$$i+1$$$,对所有$$$1\\leq i \\leq n-1$$$成立。\u003c/li\u003e\u003cli\u003e$$$n$$$条道路可以用序列$$$a_1,\\ldots,a_n$$$来描述。如果$$$a_i\u003d0$$$,则这些道路中的第$$$i$$$条是从村庄$$$i$$$到村庄$$$n+1$$$,否则是从村庄$$$n+1$$$到村庄$$$i$$$,对所有$$$1\\leq i\\leq n$$$成立。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eMocha计划和Taki这个周末去徒步旅行。为了避免旅行变得无聊,他们计划要途径每个村庄\u003cspan class\u003d\"tex-font-style-bf\"\u003e正好一次\u003c/span\u003e。他们可以从任意村庄出发和结束。你能帮助他们制定一个计划吗?\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e每个测试包含多个测试用例。\u003c/p\u003e\u003cp\u003e第一行包含一个整数$$$t$$$($$$1 \\le t \\le 20$$$)— 测试用例的数量。每个测试用例由两行组成。\u003c/p\u003e\u003cp\u003e每个测试用例的第一行包含一个整数$$$n$$$($$$1 \\le n \\le 10^4$$$)— 表示村庄的数量为$$$n+1$$$。\u003c/p\u003e\u003cp\u003e每个测试用例的第二行包含$$$n$$$个整数$$$a_1, a_2, \\ldots, a_n$$$($$$0 \\le a_i \\le 1$$$)。如果$$$a_i\u003d0$$$,表示从村庄$$$i$$$到村庄$$$n+1$$$有一条道路。如果$$$a_i\u003d1$$$,表示从村庄$$$n+1$$$到村庄$$$i$$$有一条道路。\u003c/p\u003e\u003cp\u003e保证所有测试用例中$$$n$$$的总和不超过$$$10^4$$$。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,输出一行包含$$$n+1$$$个整数,其中第$$$i$$$个数字是他们将要经过的第$$$i$$$个村庄。如果答案不存在,则输出$$$-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\u003e2\n3\n0 1 0\n3\n1 1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 4 2 3 \n4 1 2 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":"\u003cp\u003e在第一个测试用例中,城市的图形如下:\u003c/p\u003e\u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/add1e5a1dbb01fe6f1f7d129386bef11?v\u003d1715747805\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e\u003cp\u003e因此所有可能的答案是$$$(1 \\to 4 \\to 2 \\to 3)$$$,$$$(1 \\to 2 \\to 3 \\to 4)$$$。\u003c/p\u003e\u003cp\u003e在第二个测试用例中,城市的图形如下:\u003c/p\u003e\u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/08da2b8833de0604360e0a862373db3e?v\u003d1715747805\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e\u003cp\u003e因此所有可能的答案是$$$(4 \\to 1 \\to 2 \\to 3)$$$,$$$(1 \\to 2 \\to 3 \\to 4)$$$,$$$(3 \\to 4 \\to 1 \\to 2)$$$,$$$(2 \\to 3 \\to 4 \\to 1)$$$。\u003c/p\u003e"}}]}