Problem p03479 - Generation 1

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

Canonicalized Input Description:

An integer X (1 ≤ X ≤ 10^18).
An integer Y (X ≤ Y ≤ 10^18).

### Example Input:

```
3 20
```

### Function Signature:
Write a function f(inputs) that takes in the input.
def f(inputs: Tuple[int, int]):
    ''' 
    inputs: a tuple containing two integers (X, Y)
    '''

Test Case Generator

To generate test cases for this problem, we will need to ensure that we create valid integer ranges \([X, Y]\) such that \(1 \leq X \leq Y \leq 10^{18}\). The main challenge here is the enormous size of the numbers involved, which means that we need to carefully select \(X\) and \(Y\) to cover a wide range of scenarios, including edge cases.

Here is a test case generator function for this problem:

```python
import random

def tcgen():
    # Generate random values for X and Y within the given constraints.
    X = random.randint(1, 10**18)
    Y = random.randint(X, 10**18)
    
    return X, Y

# Example usage:
if __name__ == "__main__":
    for _ in range(10):
        X, Y = tcgen()
        print(f"{X} {Y}")
```

This function generates random test cases with the following logic:
1. Randomly select \(X\) from the range \([1, 10^{18}]\).
2. Randomly select \(Y\) from the range \([X, 10^{18}]\) to ensure \(X \leq Y\).

This approach ensures that all generated test cases adhere to the constraints specified in the problem statement. You can run this script to generate as many test cases as needed for thorough testing.

Here are some examples of how you might run this to generate test cases:

```python
# Example usage:
for _ in range(10):
    X, Y = tcgen()
    print(f"Input: {X} {Y}")
```

This will output 10 test cases in the format required by the problem. Each test case will consist of two integers \(X\) and \(Y\), ensuring that \(1 \leq X \leq Y \leq 10^{18}\).

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)