Given two integers L and K, find the least integer R such that the number of set bits in the range [L, R] is at least K.
Here, "number of set bits" means the number of 1 bits in the binary representation of the integers.
Task
Find the minimum value of R
Example
Assumption:
Approach:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button)
Output format
For each test case, output one integer in a single line denoting the minimum value of R.
Constraints
Number of set bits in + K <= Number of set bits in
The first integer denotes the number of test cases, T = 1
The first test case
Given:
Approach: