Sure, here is the test case generator for the given problem statement "How many ways?":

```python
import random

def tcgen():
    # Generate n within the range [3, 100]
    n = random.randint(3, 100)
    
    # Generate x within the range [0, 300]
    x = random.randint(0, 300)
    
    return n, x

# Example usage:
# Generate a random test case
n, x = tcgen()
print(n, x)
```

This function generates random values for `n` and `x` within the specified constraints. You can use this function to create multiple test cases for your problem. Here's how it works:

- `n` is generated as a random integer between 3 and 100 (inclusive).
- `x` is generated as a random integer between 0 and 300 (inclusive).

This will give you varied test cases that you can use to ensure your solution handles different inputs correctly.

Additionally, here is a small script to generate multiple test cases and append the end symbols (0, 0):

```python
def generate_multiple_test_cases(num_cases):
    test_cases = []
    for _ in range(num_cases):
        test_cases.append(tcgen())
    test_cases.append((0, 0))  # Append the end symbols
    return test_cases

# Example usage:
# Generate 5 random test cases
test_cases = generate_multiple_test_cases(5)
for n, x in test_cases:
    print(n, x)
```

This function `generate_multiple_test_cases` creates a specified number of test cases and appends the terminating `0 0` at the end, ensuring you can test the program with multiple datasets consecutively.