Certainly! Below is a Python function that generates random test cases for the "Lupin III" problem:

```python
import random

def tcgen():
    # Number of warehouses (1 ≤ n ≤ 15)
    n = random.randint(1, 15)
    
    # Generate warehouse details
    warehouses = []
    for _ in range(n):
        # Warehouse number (1 ≤ si ≤ 100)
        s = random.randint(1, 100)
        # Distance from the castle (1 ≤ di ≤ 10,000)
        d = random.randint(1, 10000)
        # Number of wooden boxes (1 ≤ vi ≤ 10,000)
        v = random.randint(1, 10000)
        warehouses.append((s, d, v))
    
    return n, warehouses

# Function to format the test case for output
def format_test_case(n, warehouses):
    result = f"{n}\n"
    for s, d, v in warehouses:
        result += f"{s} {d} {v}\n"
    return result.strip()

# Generate and format a test case
n, warehouses = tcgen()
test_case = format_test_case(n, warehouses)
print(test_case)
```

The `tcgen` function generates a random number of warehouses and then, for each warehouse, it generates random values for the warehouse number, distance from the castle, and number of wooden boxes. The `format_test_case` function formats this data into the required input format for the problem statement. The generated test case is printed at the end.

You can run this code multiple times to get different test cases for the "Lupin III" problem.