Orig Description
Score : 300 points
Problem StatementAs a token of his gratitude, Takahashi has decided to give his mother an integer sequence.
The sequence A needs to satisfy the conditions below:
A consists of integers between X and Y (inclusive).
For each 1\leq i \leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.
Find the maximum possible length of the sequence.
Constraints
1 \leq X \leq Y \leq 10^{18}
All input values are integers.
InputInput is given from Standard Input in the following format:
X Y
OutputPrint the maximum possible length of the sequence.
Sample Input 13 20
Sample Output 13
The sequence 3,6,18 satisfies the conditions.
Sample Input 225 100
Sample Output 23
Sample Input 3314159265 358979323846264338
Sample Output 331
Extracted Specification
An integer X (1 ≤ X ≤ 10^18), representing the lower bound.
An integer Y (X ≤ Y ≤ 10^18), representing the upper bound.
### Example Input:
```
3 20
```
### Function Signature:
Write a function f(X, Y) that takes in the input.
def f(X: int, Y: int):
'''
X: an integer
Y: an integer
'''
Test Case Generator
Certainly! Here is a test case generator for the given problem statement:
```python
import random
def tcgen():
# Generate values for X and Y within the given constraints
X = random.randint(1, 10**18)
Y = random.randint(X, 10**18) # Ensuring Y >= X
return X, Y
# Example of how to use the generator
if __name__ == "__main__":
for _ in range(5): # Generate 5 test cases as an example
X, Y = tcgen()
print(f"Input: {X} {Y}")
```
### Explanation:
- **X**: This is the starting point of the sequence. It is chosen randomly between 1 and 10^18.
- **Y**: This is the upper limit for the sequence. It is chosen randomly between X and 10^18 to ensure that Y is always greater than or equal to X.
This generator will produce random valid inputs for the problem according to the given constraints.
Extract Arguments
def extract_arguments(fh):
X, Y = map(int, fh.readline().strip().split())
return X, Y
# if __name__ == "__main__":
# input_path = sys.argv[1]
# with open(input_path, 'r') as fh:
# X, Y = extract_arguments(fh)
# f(X, Y)