{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e给定一个具有左侧 $$$n$$$ 个节点和右侧 $$$m$$$ 个节点的完全二分图,其中左侧的任意节点都与右侧的所有节点相连。现在你的任务是为节点分配值,使得任何整数 $$$i \\in [1,n+m]$$$ \u003cspan class\u003d\"tex-font-style-bf\"\u003e恰好出现一次\u003c/span\u003e,并且对于任何循环,循环上所有节点的值的最大公约数(Greatest Common Divisor,GCD)等于 $$$1$$$。\u003c/p\u003e\u003cp\u003e一些正整数的最大公约数是能够整除所有这些整数的最大整数。例如,$$$\\text{GCD}(4,6)\u003d2$$$,$$$\\text{GCD}(6,9,15)\u003d3$$$。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数 $$$T(1\\le T \\le 100)$$$,表示测试用例的数量。\u003c/p\u003e\u003cp\u003e每个测试用例在单独的一行中包含两个整数 $$$n,m(1\\le n,m \\le 10^{5})$$$。保证 $$$\\sum \\max(n,m) \\le 2\\cdot 10^5$$$。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,如果存在可能的分配方案,则在单独的一行中输出 \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e。然后输出两行,第一行表示左侧的节点,第二行表示右侧的节点。如果存在多个答案,可以输出任意一个。每行中的整数用空格分隔,\u003cspan class\u003d\"tex-font-style-bf\"\u003e不要在每行末尾打印任何额外的空格\u003c/span\u003e。如果打印的元素数量错误,可能会得到 $$$\\text{Presentation Error}$$$ 的判定。\u003c/p\u003e\u003cp\u003e如果不存在可能的分配方案,则在单独的一行中输出 \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\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 4\n9 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n1 4 7\n6 2 5 3\nNO\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以下图显示了一个正确的具有 $$$n\u003d3, m\u003d4$$$ 的图。\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/5818daa238495e2b7bd038a2dbedf5b4?v\u003d1715298355\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e"}}]}