XOR Game
Submissions: 434   Accuracy:

34.79%

  Difficulty: Basic   Marks: 1

Given a positive number k, we need to find a minimum value of positive integer n, such that XOR of n and n+1 is equal to k. If no such n exist then print -1.

Input:
The first line consists of an integer T i.e number of test cases. The only line of each test case consists of an integer k.

Output:
Print the required output.

Constraints: 
1<=T<=100
1<=k<=100

Example:
Input:

2
3
6

Output:
1
-1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.