Problem 4

Solution for the fourth problem