I was trying to solve the problem, but couldn’t figure out the solution. It seems some greedy concept is applied by pro coders to solve the problem. It would be good if some one could explain me his/her solution. How we can reduce it to max flow also not able to grab.