Shil Loves Exclusive Or
All submissions for this problem are available.
Shil has a number X.He challenges you to find minimum positive number K such that F(K) is equal to X.
First line of input will consists of total number of test cases T.Next T lines contains a number X.
For each test case , output minimum possible value of K such that F(K) is equal to X.If there is no such K , print -1.Note that K should be positive number.
- 1 ≤ T ≤ 1000000
- 0 ≤ X ≤ 1018
Input: 3 1 2 100 Output: 1 -1 100
F(1)=1 , F(100)=100 and there is no such K such that F(K)=2
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions