The Sparsest Number in Between
시간 제한2초메모리 제한2048 MB
1 이상 10^18 이하의 a, b가 주어질 때 [a, b] 구간에서 이진수로 표현했을 때 1의 개수가 가장 적으면서 그중 가장 작은 수를 찾는다.
문제
You are given a pair of positive integers and (). Among those integers between and , inclusive, your task is to find the sparsest one, that is, the one with the least number of 1’s in its binary representation. If there are two or more such integers, you should find the smallest among them.
Suppose, for instance, that and . The integers between and , inclusive, are , , , and , and their binary representations are 1010, 1011, 1100, and 1101, respectively. Thus, in this case, the answer is , since and have the least number of 1’s in their binary representations and is smaller than .
입력
The input consists of a single test case of the following format.
Here, and () are integers between and , inclusive.
출력
Output a line containing the smallest among the sparsest integers between and , inclusive.