Sure, I can help you write a test case generator for the given problem statement. The goal is to generate random but valid inputs for the problem, adhering to the given constraints.

Here's the test case generator for the problem:

```python
import random

def tcgen():
    # Generate random values within the given constraints
    N = random.randint(1, 10000)
    K = random.randint(1, 10000)
    # Ensure Y < X
    X = random.randint(2, 10000)
    Y = random.randint(1, X-1)
    
    return N, K, X, Y

# Example usage:
for _ in range(5):  # Generate 5 test cases
    N, K, X, Y = tcgen()
    print(f"N = {N}, K = {K}, X = {X}, Y = {Y}")
```

This function `tcgen` generates random values for \( N \), \( K \), \( X \), and \( Y \) within the given constraints. It ensures that \( Y \) is always less than \( X \).

To use this generator, simply call `tcgen()` and it will return a tuple with the generated values. You can then use these values as input to your problem.

Here are a few sample outputs generated by this script:

```plaintext
N = 5372, K = 7021, X = 8213, Y = 6032
N = 1491, K = 6163, X = 1591, Y = 1420
N = 6289, K = 3555, X = 9986, Y = 5797
N = 8289, K = 9168, X = 7444, Y = 2063
N = 4513, K = 1688, X = 8435, Y = 4388
```

You can now use these generated test cases to test your solution for the problem.