Added solution to the fifth problem.