Problem p03479 - Generation 3

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).
An integer Y (X ≤ Y ≤ 10^18).

### 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! To create a test case generator for the given problem statement, we need to generate random values for \(X\) and \(Y\) such that \(1 \leq X \leq Y \leq 10^{18}\). Here is a Python function to generate such test cases:

```python
import random

def tcgen():
    X = random.randint(1, 10**18)
    Y = random.randint(X, 10**18)
    
    return X, Y

# Example usage
for _ in range(5):
    print(tcgen())
```

This function will generate random pairs of integers \(X\) and \(Y\) that satisfy the constraints given in the problem statement. Here is a brief explanation:

1. **X** is chosen randomly between 1 and \(10^{18}\) (inclusive).
2. **Y** is chosen randomly between \(X\) and \(10^{18}\) (inclusive), ensuring that \(X \leq Y\).

This test case generator ensures that the constraints \(1 \leq X \leq Y \leq 10^{18}\) are always met, providing valid inputs for the problem.

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)