Some more Homework: Help Required

Can someone please explain algorithm to solve the problem ? Pls no hints.Just plain simple algorithm!!

//