{"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\u003eGiven a full bipartite graph with $$$n$$$ nodes on the left and $$$m$$$ nodes on the right where any node on the left is connected to all nodes on the right. Your task is now to assign values to the nodes such that any integer $$$i \\in [1,n+m]$$$ occurs \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly once\u003c/span\u003e and that for any cycle, the GCD (Greatest Common Divisor) of the values of all the nodes on the cycle is equal to $$$1$$$. \u003c/p\u003e\u003cp\u003eThe GCD of some positive integers is the maximum integer that divides all the integers. For example, $$$\\text{GCD}(4,6)\u003d2$$$, $$$\\text{GCD}(6,9,15)\u003d3$$$.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$T(1\\le T \\le 100)$$$, indicating the number of test cases.\u003c/p\u003e\u003cp\u003eEach test case contains two integers $$$n,m(1\\le n,m \\le 10^{5})$$$ in a single line. It is guaranteed that $$$\\sum \\max(n,m) \\le 2\\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, if there exists a possible assignment, output \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e in a single line. Then output two lines, the first of which indicates the nodes on the left, while the second of which contains the nodes on the right. If there are multiple answers, print any. The integers in each line are separated by spaces, and \u003cspan class\u003d\"tex-font-style-bf\"\u003eDO NOT PRINT ANY EXTRA SPACES\u003c/span\u003e at the end of each line. If you print the wrong number of elements, you will possibly get a $$$\\text{Presentation Error}$$$ verdict.\u003c/p\u003e\u003cp\u003eIf there\u0027s no possible assignment, output \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e in a single line.\u003c/p\u003e"}},{"title":"Examples","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\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe following figure shows a correct graph with $$$n\u003d3, m\u003d4$$$. \u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/5818daa238495e2b7bd038a2dbedf5b4?v\u003d1726223748\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e"}}]}