prob_3 solve