prob_8 solve