Problem p01351 - Generation 2

Orig Description

Problem C: Usagitobi
There is a board of m × n squares. The square in the i-th row and j-th column is represented as (i, j) (0 ≤ i < m, 0 ≤ j < n).
When the rabbit is at (x, y), it can jump to ((x + a) mod m, (y + b) mod n) or ((x + c) mod m, (y + d) mod n).
Now, the rabbit is at (0, 0). Assuming that it cannot go back to a square it has jumped to before, how many times can the rabbit jump at most?
Input
The input is given on a single line and consists of six integers m, n, a, b, c, and d separated by a space. 1 ≤ m, n, a, b, c, d ≤ 100,000.
Output
Output the maximum number of times the rabbit can jump on a single line.
Sample Input 1
6 6 2 2 2 4
Sample Output 1
8

Extracted Specification

An integer m (1 ≤ m ≤ 100,000), representing some quantity or size.
An integer n (1 ≤ n ≤ 100,000), representing some quantity or size.
An integer a (1 ≤ a ≤ 100,000), representing some quantity or size.
An integer b (1 ≤ b ≤ 100,000), representing some quantity or size.
An integer c (1 ≤ c ≤ 100,000), representing some quantity or size.
An integer d (1 ≤ d ≤ 100,000), representing some quantity or size.

### Example Input:

```
6 6 2 2 2 4
```

### Function Signature:
Write a function f(inputs) that takes in the input.
```python
def f(inputs: Tuple[int, int, int, int, int, int]):
    ''' 
    inputs: a tuple of six integers
    '''
```

Test Case Generator

Sure, I can help you write a test case generator for the "Usagitobi" problem. Here's how you can do it:

```python
import random

def tcgen():
    # Generate random values for m, n, a, b, c, and d within the given constraints
    m = random.randint(1, 100000)
    n = random.randint(1, 100000)
    a = random.randint(1, 100000)
    b = random.randint(1, 100000)
    c = random.randint(1, 100000)
    d = random.randint(1, 100000)
    
    return m, n, a, b, c, d

# Example of how to use the generator and print the result
for _ in range(5):  # Generate 5 test cases
    print(tcgen())
```

This generator will produce random test cases for the "Usagitobi" problem based on the given constraints. Each call to `tcgen()` will generate a new set of values for `m`, `n`, `a`, `b`, `c`, and `d` within the range of 1 to 100,000. 

You can run the loop multiple times to generate and print multiple test cases. Modify the loop count to generate as many test cases as you need.

Extract Arguments

def extract_arguments(fh):
    m, n, a, b, c, d = map(int, fh.readline().strip().split())
    return m, n, a, b, c, d