AT_arc231_b [ARC231B] Three Mex

Description

You are given non-negative integers $ A, B, C $ . Determine whether there exist sets of non-negative integers $ X, Y $ satisfying the following three conditions, and if they exist, show one example. - Each element of $ X, Y $ is a non-negative integer at most $ 2026 $ . - $ \mathrm{mex}(X)=A, \mathrm{mex}(Y)=B $ . - Define the set of non-negative integers $ Z $ as $ Z=\{x\oplus y\mid x\in X, y \in Y\} $ . Then, $ \mathrm{mex}(Z)=C $ . Here, $ \oplus $ denotes the bitwise $ \mathrm{XOR} $ operation. What is $ \mathrm{mex}(S) $ ? For a finite set $ S $ of non-negative integers, $ \mathrm{mex}(S) $ is defined as the smallest non-negative integer $ s $ satisfying $ s\notin S $ . What is the bitwise $ \mathrm{XOR} $ operation? The bitwise $ \mathrm{XOR} $ of non-negative integers $ x $ and $ y $ , $ x \oplus y $ , is defined as follows. - When $ x \oplus y $ is written in binary, the digit in the $ 2^k $ ( $ k \geq 0 $ ) place is $ 1 $ if exactly one of the digits in the $ 2^k $ place of $ x $ and $ y $ written in binary is $ 1 $ , and $ 0 $ otherwise. For example, $ 3 \oplus 5 = 6 $ (in binary: $ 011 \oplus 101 = 110 $ ). Solve $ T $ test cases per input file.

Input Format

The input is given from Standard Input in the following format. Here, $ \mathrm{case}_i $ ( $ 1 \leq i \leq T $ ) denotes the $ i $ -th test case. > $ T $ $ \mathrm{case}_1 $ $ \mathrm{case}_2 $ $ \vdots $ $ \mathrm{case}_T $ Each test case is given in the following format: > $ A $ $ B $ $ C $

Output Format

Output the answers in the order $ \mathrm{case}_1, \mathrm{case}_2, \cdots, \mathrm{case}_T $ . For each test case, output as follows. - If there do not exist sets of non-negative integers $ X, Y $ satisfying the conditions, output `No` followed by a newline. - If there exist sets of non-negative integers $ X, Y $ satisfying the conditions, output one example in the following format. Let $ N, M $ be the numbers of elements of $ X, Y $ , respectively, let $ X_i $ be the $ i $ -th element ( $ 1 \leq i \leq N $ ) of $ X $ , and let $ Y_j $ be the $ j $ -th element ( $ 1 \leq j \leq M $ ) of $ Y $ . Here, $ X_1, X_2, \cdots, X_N $ must be pairwise distinct. Also, $ Y_1, Y_2, \cdots, Y_M $ must be pairwise distinct. If there are multiple pairs of sets of non-negative integers $ X, Y $ satisfying the conditions, any of them will be judged as correct. > Yes $ N $ $ X_1 $ $ X_2 $ $ \cdots $ $ X_N $ $ M $ $ Y_1 $ $ Y_2 $ $ \cdots $ $ Y_M $

Explanation/Hint

### Sample Explanation 1 - For the first test case, since $ X = \{ 0, 1, 3 \}, Y = \{ 0, 1, 2, 4 \} $ , we have $ Z = \{0, 1, 2, 3, 4, 5, 7 \} $ , which satisfies $ \mathrm{mex}(X) = 2, \mathrm{mex}(Y) = 3, \mathrm{mex}(Z) = 6 $ . - For the second test case, there do not exist sets of non-negative integers $ X, Y $ satisfying the conditions. - For the fourth test case, $ X, Y $ may be empty sets. ### Constraints - $ 1 \leq T \leq 10 $ - $ 0 \leq A \leq 1000 $ - $ 0 \leq B \leq 1000 $ - $ 0 \leq C \leq 1000 $ - All input values are integers.