the solution to the problem b