Problem Link:[Here](http://lightoj.com/volume_showproblem.php?problem=1071)
I have already solved this problem using Dp.
But in Tag I have seen that it can be solved with Min cost Max flow.
Give some Hints how can i solve this problem using Min cost Max flow.
Thanks in Adavance