407535: GYM102823 D Bits Reverse
Description
Now given two integers $$$x$$$ and $$$y$$$, you can reverse every consecutive three bits in arbitrary number's binary form (any leading zero can be taken into account) using one coin. Reversing $$$(1, 2, 3)$$$ means changing it into $$$(3, 2, 1)$$$.
Could you please find a way that minimize number of coins so that $$$x = y$$$? If you can, just output the minimum coins you need to use.
InputThe first line of input file contains only one integer $$$T$$$ ($$$1\le T\le 10000$$$) indicating number of test cases.
Then there are $$$T$$$ lines followed, with each line representing one test case.
For each case, there are two integers $$$x$$$, $$$y$$$ ($$$0\le x, y \le 10^{18}$$$) described above.
OutputPlease output $$$T$$$ lines exactly.
For each line, output Case $$$d$$$: ($$$d$$$ represents the order of the test case) first. Then output the answer in the same line. If there is no way for that, print -1 instead.
ExampleInput3Output
0 3
3 6
6 9
Case 1: -1Note
Case 2: 1
Case 3: 2
- Sample 1: Considering following two binary string:
$$$0$$$: $$$0\cdots0000$$$
$$$3$$$: $$$0\cdots0011$$$
There is no way to achieve the goal.
- Sample 2: Considering following two binary string:
$$$3$$$: $$$0\cdots0011$$$
$$$6$$$: $$$0\cdots0110$$$
You can reverse the lowest three digits in $$$3$$$ so that $$$3$$$ is changed into $$$6$$$.
You just need to perform one reverse so that the minimum coin you need to use is $$$1$$$.