{"trustable":true,"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":"\u003cdiv class\u003d\"panel_content\"\u003e给定一个顶点数为$n$的无向完全图($n$为奇数)。你需要将其边集分成$k$个$\\pmb{\\text{disjoint simple}}$路径,满足第$i$个简单路径的长度为$l_i$($1\\leq i \\leq k, 1 \\leq l_i \\leq n-3$),并且每条无向边恰好被使用一次。\u003cbr\u003e\u003cbr\u003e完全图是一个简单无向图,其中每对不同的顶点都由一条唯一的边连接。这里的长度为$l$的简单路径意味着路径覆盖了$l$条边,并且路径中的顶点两两不同。\u003cbr\u003e\u003cbr\u003e可以证明,如果$\\sum\\limits_{i\u003d1}^k l_i \u003d \\frac{n(n-1)}{2}$成立,那么总是存在一个答案。\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"第一行包含一个整数$T(1 \\leq T \\leq 100000)$ - 测试用例的数量。然后是$T$个测试用例。\u003cbr\u003e\u003cbr\u003e每个测试用例的第一行包含两个整数$n, k(5 \\leq n \\leq 1000, 1 \\leq k \\leq \\frac{n(n-1)}{2}, n \\equiv 1 \\pmod 2)$ - 顶点数和路径数。\u003cbr\u003e\u003cbr\u003e接下来一行包含$k$个整数$l_1, l_2, \\cdots, l_k(1 \\le l_i \\le n-3)$ - 每条路径的长度。\u003cbr\u003e\u003cbr\u003e保证每个测试用例满足$\\sum\\limits_{i\u003d1}^k l_i \u003d \\frac{n(n-1)}{2}$,并且$\\sum \\frac{n(n-1)}{2} \\leq 4 \\times 10^6$。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,首先输出一行包含\"Case #x:\",其中$x(1 \\leq x \\leq T)$是测试用例编号。然后输出$k$行。第$i$行包含$l_i + 1$个数字,表示第$i$条路径。\u003cbr\u003e\u003cbr\u003e如果存在多个答案,可以输出任意一个。\u003cbr\u003e\u003cbr\u003e$\\pmb{\\text{Due to technical reasons, please, do not output extra spaces at the end of each line!}}$\u003cbr\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\u003e3\r\n5 6\r\n2 1 1 2 2 2\r\n7 8\r\n1 1 4 3 4 1 3 4\r\n5 10\r\n1 1 1 1 1 1 1 1 1 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1:\r\n5 4 2\r\n2 3\r\n5 1\r\n2 1 4\r\n3 5 2\r\n1 3 4\r\nCase #2:\r\n6 7\r\n1 3\r\n6 5 1 2 3\r\n7 1 4 2\r\n1 6 4 7 5\r\n7 3\r\n2 6 3 5\r\n3 4 5 2 7\r\nCase #3:\r\n5 3\r\n5 2\r\n4 3\r\n1 5\r\n1 3\r\n2 3\r\n4 2\r\n4 1\r\n1 2\r\n4 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}