#P9591. 「PFLOI R1」PFL 变换
「PFLOI R1」PFL 变换
Background
Five top experts have gathered here, and sparks of ideas collide fiercely. Soon, PFLOI Round 1 is ready.
It begins...
Problem Description
A new journey has begun: Zhili has set out to look for bananas. There are a total of bananas on the road, numbered from to .
Seeing such delicious food, Zhili is very excited. However, Zhili does not want to eat too much or too little, so it will eat exactly bananas.
Zhili is very picky. It will only be satisfied if the XOR sum of the indices of the bananas it eats is exactly . Please help find which bananas it should eat to make it satisfied.
If Zhili's requirement cannot be satisfied no matter what, please output -1.
Formal statement:
Please choose numbers from to such that their XOR sum is exactly . If there is no solution, output -1.
Input Format
This problem has multiple test cases.
The first line contains an integer , meaning there are test cases in total.
For each test case, each line contains two integers and , with meanings as described in the statement.
Output Format
For each test case, if there is a solution, output one line with integers, representing the numbers you choose. If there is no solution, output -1.
This problem uses Special Judge. If there are multiple possible solutions, you may output any one of them.
7
5 2
6 6
7 6
8 3
9 3
10 1
7 4
3 4
1 6 2 4 3 5
1 2 3 4 5 6
8 6 1
8 1 6
-1
3 5 6 7
Hint
This problem does not use bundled tests.
| Test Point ID | Special Property | Score |
|---|---|---|
| No special restrictions | ||
Constraints: For all testdata, , .
Translated by ChatGPT 5