Need help in this question

So, I was solving problems for interview prepartion and I came across this question below:

Description
An n*m rectangular cake with k strawberries. Now cut the cake so that there is one on each cake (which means you can't cut the cake without strawberries), and you can only cut it horizontally or Cut vertically to find the shortest cut length.

Note:

n, m do not exceed 20
The two-dimensional array mp is the coordinates of the k strawberry.

Examples:

Example 1:

Input: n = 3, m = 4, k = 3, mp = [[1, 2], [2, 3], [3, 2]]
Output: 5
Explanation:
Cut vertically in the middle and cut half of the cake with 2 strawberries.

Example 2:

Input: n = 2, m = 2, k = 2, mp = [[1, 1], [2, 2]]
Output: 2
Explanation:
Cut vertically in the middle.

I'm not able to think any approach for this problem. Can someone help me?

Comments (3)