To create a test case generator for this problem, we can follow the same pattern as the previous example. We'll generate random values for \(N\) and \(M\) within their respective constraints. Here's the Python code to generate such test cases:

```python
import random

def tcgen():
    # Constraints
    N = random.randint(1, 3000)
    M = random.randint(1, 3000)
    
    return N, M

# Example usage:
for _ in range(5):
    print(tcgen())
```

This code will generate random values for \(N\) and \(M\) within the given constraints (1 ≤ \(N\) ≤ 3000 and 1 ≤ \(M\) ≤ 3000). Each call to `tcgen` will produce a new pair of values.

### Explanation:
1. **N**: Represents the total number of bricks initially put into the box.
2. **M**: Represents the number of operations to be performed, where each operation consists of removing a brick, adding a red and a blue brick, and then removing another brick.

### Example Usage:
Running the `tcgen` function will produce output like:
```
(2856, 1234)
(1731, 2420)
(187, 1990)
(1321, 545)
(899, 2087)
```

Each tuple represents a valid test case for the problem described. These values can be used as inputs to test the solution to the problem.