Problem p02646 - Generation 1

Orig Description

Score : 200 points
Problem StatementTwo children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second.
The other child is now at coordinate B, and she can travel the distance of W per second.
He can catch her when his coordinate is the same as hers.
Determine whether he can catch her within T seconds (including exactly T seconds later).
We assume that both children move optimally.
Constraints
-10^9 \leq A,B \leq 10^9
1 \leq V,W \leq 10^9
1 \leq  T \leq 10^9
A \neq B
All values in input are integers.
InputInput is given from Standard Input in the following format:
A V
B W
T
OutputIf "it" can catch the other child, print YES; otherwise, print NO.
Sample Input 11 2
3 1
3
Sample Output 1YES
Sample Input 21 2
3 2
3
Sample Output 2NO
Sample Input 31 2
3 3
3
Sample Output 3NO

Extracted Specification

An integer \(A\) (\(-10^9 \leq A \leq 10^9\)).
An integer \(V\) (\(1 \leq V \leq 10^9\)).
An integer \(B\) (\(-10^9 \leq B \leq 10^9\)).
An integer \(W\) (\(1 \leq W \leq 10^9\)).
An integer \(T\) (\(1 \leq T \leq 10^9\)).

### Example Input:
```
1 2
3 1
3
```

### Function Signature:
Write a function f(A, V, B, W, T) that takes in the input.
def f(A: int, V: int, B: int, W: int, T: int):
    '''
    A: an integer
    V: an integer
    B: an integer
    W: an integer
    T: an integer
    '''

Test Case Generator

Sure, I can write a test case generator for the problem statement you've provided. Here is the Python code for the test case generator:

```python
import random

def tcgen():
    A = random.randint(-10**9, 10**9)
    B = random.randint(-10**9, 10**9)
    
    # Ensure A != B
    while A == B:
        B = random.randint(-10**9, 10**9)
    
    V = random.randint(1, 10**9)
    W = random.randint(1, 10**9)
    T = random.randint(1, 10**9)

    return A, V, B, W, T

# Example of generating a test case
A, V, B, W, T = tcgen()
print(f"{A} {V}")
print(f"{B} {W}")
print(f"{T}")
```

### Explanation of the Code:
1. **A and B**: These are the coordinates of the two children. They are randomly generated between -10^9 and 10^9, ensuring that `A` is not equal to `B`.
2. **V and W**: These represent the distances that "it" and the other child can travel per second, respectively. They are randomly generated between 1 and 10^9.
3. **T**: This represents the number of seconds within which "it" must catch the other child. It is randomly generated between 1 and 10^9.

### Sample Output:
The generator will output values formatted as in the problem statement. Here is an example run:

```
-1000000000 999999999
1000000000 1
5000000
```

This output represents:
1. The "it" child's starting coordinate is `-1000000000` and can travel `999999999` units per second.
2. The other child's starting coordinate is `1000000000` and can travel `1` unit per second.
3. The time limit is `5000000` seconds.

Feel free to run the test case generator multiple times to get different test cases for your problem!

Extract Arguments

def extract_arguments(fh):
    A, V = map(int, fh.readline().strip().split())
    B, W = map(int, fh.readline().strip().split())
    T = int(fh.readline().strip())
    return A, V, B, W, T

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh: 
#     A, V, B, W, T = extract_arguments(fh)
#     f(A, V, B, W, T)