------
## 最终结论
```python
def min_squares(n, m):
    # Create a memoization table
    dp = [[float('inf')] * (m + 1) for _ in range(n + 1)]
    
    # Base case: It takes 1 square to fill a square area
    for i in range(1, min(n, m) + 1):
        dp[i][i] = 1

    # Fill the dp table
    for i in range(1, n + 1):
        for j in range(1, m + 1):
            if i == j:
                continue
            # Try all possible sizes of squares
            for k in range(1, min(i, j) + 1):
                dp[i][j] = min(dp[i][j], dp[i - k][j] + dp[k][k])
                dp[i][j] = min(dp[i][j], dp[i][j - k] + dp[k][k])
    
    return dp[n][m]

# Example usage:
print(min_squares(2, 3))  # Output: 3
print(min_squares(5, 8))  # Output: 5
print(min_squares(11, 13))  # Output: 6
```