fill candies problem by iitb

link to problem http://www.codechef.com/ZERO1/problems/TF06/
Give me link/stuff to analysis of this problem.

Looking at the solutions, it seems that using max flow was one of the possibilities. So if you’re not aware of this technique, you should read about it first.