#P17338. 【MX-X30-T4】超立方体
【MX-X30-T4】超立方体
Problem Description
You are given two integers . Now you have a graph with vertices, numbered . For any two vertices , there is an edge between them if and only if , that is, these two numbers differ in exactly one bit in binary.
You need to choose simple cycles (cycles with no repeated vertices) in this graph, such that each vertex belongs to exactly one simple cycle. You need to output a construction or report that there is no solution.
Input Format
This problem contains multiple test cases. The first line contains an integer indicating the number of test cases.
Each test case contains one line with two integers .
Output Format
Output separately for each test case.
If you think this test case has no solution, output one line with the string .
Otherwise, first output one line with the string , followed by lines.
In each line, the first integer denotes the length of the cycle, then output in the order along the cycle.
You must ensure that these vertices are all distinct, and for , there is an edge between and . In particular, there is an edge between and .
You must ensure that among the vertices, each vertex belongs to exactly one simple cycle. You must ensure .
2
2 1
3 2
Yes
4 0 1 3 2
Yes
4 0 1 3 2
4 4 5 7 6
Hint
| Test Point ID | Special Property | |
|---|---|---|
| None | ||
| A | ||
| None | ||
Special property A: .
For all testdata, , , .
Translated by ChatGPT 5