문제
Lately, the cows on Farmer John's farm have been infatuated with watching the show Apothecowry Dairies. The show revolves around a clever bovine sleuth CowCow solving problems of various kinds. Bessie found a new problem from the show, but the solution won't be revealed until the next episode in a week! Please solve the problem for her.
You are given integers and . Please choose a positive integer and construct a sequence of non-negative integers such that the following conditions are satisfied:
If no such sequence exists, print .
is the number of bits equal to in the binary representation of the integer . For instance, the popcount of is and the popcount of is .
is the bitwise xor operator.
The input will consist of () independent test cases.
입력
The first line contains .
The first and only line of each test case has and .
It is guaranteed that all test cases are unique.
출력
Output the solutions for test cases as follows:
If no answer exists, the only line for that test case should be .
Otherwise, the first line for that test case should be a single integer , the length of the sequence -- ().
The second line for that test case should contain space-separated integers that satisfy the conditions -- ().
예제 입력 1
3
2 1
33 5
10 5
예제 출력 1
2
2 0
3
3 23 7
-1
점수
Input 2: Inputs 3-5: Inputs 6-18: No additional constraints.
코드를 제출하려면 로그인이 필요합니다.
로그인