Problem p02024 - Generation 3

Orig Description

E: City
Santa decided to deliver presents to a city.
This city has the shape of a rectangle divided into $H$ rows and $W$ columns, and each cell contains one house that he has to deliver a present to.
The houses are numbered from $(1,1)$ to $(H,W)$ in row-major order.
Santa moves according to the following conditions:
He starts at cell $(S,T)$.
At each step, he can move to one of the four neighboring cells (north, south, east or west) as long as he stays inside the city.
He cannot visit any cell more than once.
Determine whether Santa can visit all the houses in the city or not.
Input
The input consists of a single line containing four integers $H$, $W$, $S$ and $T$ separated by a single space.
Output
If Santa can visit all the houses in the city, print "Yes". Otherwise, print "No".
Constraints
$2 \leq H, W \leq 10^9$
$1 \leq S \leq H$
$1 \leq T \leq W$
Sample Input 1
4 5 2 3
Sample Output 1
Yes
For example, he can follow this path:
Sample Input 2
3 3 1 2
Sample Output 2
No

Extracted Specification

An integer H (2 ≤ H ≤ 10^9), representing some quantity or size.
An integer W (2 ≤ W ≤ 10^9), representing some quantity or size.
An integer S (1 ≤ S ≤ H), representing some quantity or size.
An integer T (1 ≤ T ≤ W), representing some quantity or size.

### Example Input:

```
4 5 2 3
```

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

Test Case Generator

Here is a test case generator for the given problem statement:

```python
import random

def tcgen():
    # Constraints
    H = random.randint(2, 10**9)
    W = random.randint(2, 10**9)
    S = random.randint(1, H)
    T = random.randint(1, W)
    
    return H, W, S, T

# Example of generating a test case
H, W, S, T = tcgen()
print(H, W, S, T)
```

Explanation of the test case generator:
1. **H**: The number of rows in the city. It is randomly chosen between 2 and \(10^9\).
2. **W**: The number of columns in the city. It is randomly chosen between 2 and \(10^9\).
3. **S**: The starting row position of Santa. It is randomly chosen between 1 and \(H\).
4. **T**: The starting column position of Santa. It is randomly chosen between 1 and \(W\).

The generator will provide a set of values for \(H\), \(W\), \(S\), and \(T\) which can be used as a test case for the given problem.

Note: Since \(H\) and \(W\) can be extremely large, running and verifying such large test cases might be impractical for typical competitive programming environments. This generator is provided based on the constraints given, but you might want to use smaller values for practical testing purposes.

Extract Arguments

def extract_arguments(fh):
    H, W, S, T = map(int, fh.readline().strip().split())
    return H, W, S, T