TAIDADA
InterviewTime limit1sMemory limit1024 MB
Pick N distinct integers from 1 to M so that no two of them XOR to K, or report -1 when that is impossible.
Problem
The Monthly Hyangyuhoe continues in 2025 as well.
Construct a sequence of distinct integers, each between and inclusive, that satisfies the following condition.
is the bitwise XOR operation.
Input
The first line contains the length of the sequence , and the positive integers and , separated by spaces.
Output
If a sequence can be constructed, print its elements separated by spaces on one line. Otherwise, print -1.
If several sequences satisfy the condition, print any of them.