#ABC476G. 递增的 popcount / Increasing Popcount
递增的 popcount / Increasing Popcount
Problem Statement
You are given positive integers and satisfying .
A sequence of positive integers of length satisfying the following condition is called a good integer sequence:
- For every pair of integers satisfying , if , then $\operatorname{popcount}(i)<\operatorname{popcount}(j)$.
Find the minimum value of over all good integer sequences .
You are given test cases; solve each of them.
What is ? For a non-negative integer , is the number of 's when is written in binary. More precisely, when a non-negative integer satisfies $\displaystyle x=\sum _ {i=0} ^ \infty b _ i2 ^ i\ (b _ i\in\lbrace0,1\rbrace)$, $\displaystyle\operatorname{popcount}(x)=\sum _ {i=0} ^ \infty b _ i$.
For example, written in binary is 1101, so .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Each test case is given in the following format.
Output
Output lines.
The -th line should contain the answer for the -th test case .
5
3 6
1 1
2 15
100 10000000
514284786278117031 620546740167642909
3
1
6
1636985
11375123021856567
Consider the first test case.
is a good integer sequence, and .
There is no good integer sequence with , so output on the first line.
- Source: AtCoder ABC 476 G
相关
在下列比赛中: