{"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":"在我玩过的乐透中,必须从集合{1,2,...,49}中选择6个数字。玩乐透的一种流行策略 - 虽然它不会增加你获胜的机会 - 是选择包含这49个数字中的k(k\u003e6)的子集S,然后玩几个游戏,只从S中选择数字。例如,对于 k\u003d8 和 S \u003d {1,2,3,5,8,13,21,34},有 28 种可能的游戏结果:[1,2,3,5,8,13]、[1,2,3,5,8,21]、[1,2,3,5,8,34]、[1,2,3,5,13,21],...[3,5,8,13,21,34]。\n\n你的工作是编写一个程序,读取数字k和集合S,然后打印所有可能的游戏结果,只从S中选择数字。"}},{"title":"Input","value":{"format":"HTML","content":"输入文件将包含一个或多个测试用例。每个测试用例由一行组成,其中包含多个用空格分隔的整数。该行上的第一个整数将是数字 k(6 \u003c k \u003c 13)。然后,指定集合 S 的 k 个整数将按升序排列。对于 k,输入将以零 (0) 的值终止。"}},{"title":"Output","value":{"format":"HTML","content":"对于每个测试用例,将所有可能的游戏打印在一行上。每个游戏的数字必须按升序排序,并且彼此之间正好隔一个空格。游戏本身必须按字典顺序排序,这意味着首先按最低数字排序,然后按第二个最低数字排序,依此类推,如下面的示例输出所示。测试用例必须彼此之间正好用一个空行分隔。不要在最后一个测试用例之后放置空行。"}},{"title":"Sample","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\u003e\u003cpre\u003e7 1 2 3 4 5 6 7\n8 1 2 3 5 8 13 21 34\n0\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e1 2 3 4 5 6\n1 2 3 4 5 7\n1 2 3 4 6 7\n1 2 3 5 6 7\n1 2 4 5 6 7\n1 3 4 5 6 7\n2 3 4 5 6 7\n\n1 2 3 5 8 13\n1 2 3 5 8 21\n1 2 3 5 8 34\n1 2 3 5 13 21\n1 2 3 5 13 34\n1 2 3 5 21 34\n1 2 3 8 13 21\n1 2 3 8 13 34\n1 2 3 8 21 34\n1 2 3 13 21 34\n1 2 5 8 13 21\n1 2 5 8 13 34\n1 2 5 8 21 34\n1 2 5 13 21 34\n1 2 8 13 21 34\n1 3 5 8 13 21\n1 3 5 8 13 34\n1 3 5 8 21 34\n1 3 5 13 21 34\n1 3 8 13 21 34\n1 5 8 13 21 34\n2 3 5 8 13 21\n2 3 5 8 13 34\n2 3 5 8 21 34\n2 3 5 13 21 34\n2 3 8 13 21 34\n2 5 8 13 21 34\n3 5 8 13 21 34\n\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}