407123: GYM102697 094 Computer Love
Description
You love your computer, and you want to give it a present: a large integer. However, your computer especially loves powers of two. Given two numbers $$$x$$$ and $$$y$$$, find the largest power of two between $$$x$$$ and $$$y$$$, i.e. find the largest number $$$n$$$ such that $$$x$$$ <= $$$n$$$ <= $$$y$$$, and $$$n$$$ is a power of two.
InputThe only line of input contains two space-separated integers $$$x$$$ and $$$y$$$: the lower and upper bounds of the range described in the problems statement. The values are inclusive, i.e. $$$x$$$ and $$$y$$$ could potentially be valid answers if they were powers of two.
OutputOutput a single integer $$$n$$$: the largest power of two such that $$$x$$$ <= $$$n$$$ <= $$$y$$$. If there aren't any powers of two between $$$x$$$ and $$$y$$$, output $$$-1$$$. The answer is guaranteed to be within the bounds of 32-bit signed integers.
ExamplesInput6 18Output
16Input
35 55Output
-1Input
86 375Output
256