Problem 17 Solution