In an $m \times n$ grid, each square is either filled or not filled. For each square, its [i]value[/i] is defined as $0$ if it is filled and is defined as the number of neighbouring filled cells if it is not filled. Here, two squares are neighbouring if they share a common vertex or side. Let $f(m,n)$ be the largest total value of squares in the grid. Determine the minimal real constant $C$ such that $$\frac{f(m,n)}{mn} \le C$$holds for any positive integers $m,n$

[i]CSJL[/i]
1. **Understanding the Grid and Values:**
   - Each square in the grid can have up to 8 neighbors (if it is not on the edge or corner).
   - The value of a filled square is \( 0 \).
   - The value of an unfilled square is the number of its neighboring filled squares.

2. **Maximizing the Total Value \( f(m,n) \):**
   - To maximize the total value, we need to maximize the number of unfilled squares that have the maximum possible number of filled neighbors.
   - Consider a checkerboard pattern where filled and unfilled squares alternate. This pattern ensures that each unfilled square has the maximum number of filled neighbors.

3. **Checkerboard Pattern Analysis:**
   - In a checkerboard pattern, each unfilled square (white square) is surrounded by filled squares (black squares).
   - For an interior unfilled square, it has 8 neighbors, but only 4 of them are filled (since it is a checkerboard pattern).
   - For edge and corner unfilled squares, the number of filled neighbors will be less.

4. **Calculating the Total Value \( f(m,n) \):**
   - Let’s denote the number of unfilled squares as \( U \) and the number of filled squares as \( F \).
   - In a checkerboard pattern, approximately half of the squares are filled and half are unfilled.
   - Each unfilled square has approximately 4 filled neighbors (on average, considering edge effects).

5. **Bounding \( f(m,n) \):**
   - The total value \( f(m,n) \) is approximately \( 4U \) since each unfilled square contributes 4 to the total value.
   - Since \( U \approx \frac{mn}{2} \), we have:
     \[
     f(m,n) \approx 4 \cdot \frac{mn}{2} = 2mn
     \]

6. **Finding the Constant \( C \):**
   - We need to find \( C \) such that:
     \[
     \frac{f(m,n)}{mn} \le C
     \]
   - From the above calculation, we have:
     \[
     \frac{f(m,n)}{mn} \approx \frac{2mn}{mn} = 2
     \]
   - Therefore, \( C \ge 2 \).

7. **Verifying the Bound:**
   - To ensure that \( C = 2 \) is the minimal constant, we need to check if there are configurations where \( \frac{f(m,n)}{mn} \) exceeds 2.
   - Given the checkerboard pattern provides a tight bound, and no other configuration can provide a higher average value per square, \( C = 2 \) is indeed the minimal constant.

\(\blacksquare\)

The final answer is \( \boxed{ C = 2 } \).