#5 - subproblem a complete
#5 - subproblem b complete