#P11747. 「TPOI-1A」鞋子特大号
「TPOI-1A」鞋子特大号
Description
Given a number , you can perform the following operations multiple times until no longer possible:
- Choose a number satisfying and , then replace with .
There are queries of two types:
1 x: Given , find the maximum number of operations that can be performed on ;2 q: Given , find the smallest such that the maximum number of operations on is exactly .
Input Format
The first line contains an integer , the number of queries.
Each of the next lines contains a query in the format 1 x or 2 q.
Output Format
For each query, output one integer as the answer.
2
1 2310
2 6
4
128
Hint
Explanation for Sample #1
For 1 2310, one possible operation sequence is:
- Choose , then ;
- Choose , then ;
- Choose , then ;
- Choose , then .
No further operations can be performed, so the result is .
It can be proven that no method allows more than operations.
For 2 6, it can be proven that no number smaller than can perform exactly operations.
Constraints
This problem uses bundled tests. You must pass all test cases in a subtask to receive points.
| Subtask | Special Constraints | Points |
|---|---|---|
| 0 | Sample | 0 |
| 1 | , , | 40 |
| 2 | , , | 30 |
| 3 | No special constraints |
For data: , , .
Translated by DeepSeek R1
京公网安备 11011102002149号