I think the problem is quite clear. Is there a specific part you don’t understand?
I can’t explain how the answer to the test case is obtained without explaining the general algorithm.
The diagram on the page is not proportionally correct. Perhaps this is a source of confusion?