Illustrative example of the problem: