To generate test cases for the given problem statement, we need to consider generating random grids of varying sizes and contents within the provided constraints. Here's a Python function to generate such test cases:

```python
import random

def tcgen():
    # Randomly choose H and W within the given constraints
    H = random.randint(1, 6)
    W = random.randint(1, 6)
    
    # Randomly generate the grid
    grid = []
    for _ in range(H):
        row = ''.join(random.choice(['.', '#']) for _ in range(W))
        grid.append(row)
    
    # Randomly choose K within the given constraints
    K = random.randint(1, H * W)
    
    # Output the test case
    print(H, W, K)
    for row in grid:
        print(row)

# Example usage
for _ in range(5):  # Generate 5 test cases
    tcgen()
    print()  # Separate each test case output for readability
```

This function generates test cases with random values for \(H\), \(W\), and \(K\), and a grid of characters where each character is either `.` or `#`. The constraints are respected, and the grid is printed in the required format.

### Explanation:
- **H and W**: These are chosen randomly between 1 and 6, inclusive, to match the constraints.
- **Grid**: Each row of the grid is generated by randomly choosing characters from the set {'.', '#'}.
- **K**: This is chosen randomly within the range [1, H * W] to ensure it is within the valid range of possible black squares.

This generator can be used to produce various test cases to test the robustness of the solution to the problem.