HELP IN MINSUBAR

Even after reading the editorial and seeing the solution to the problem I cannot understand how to solve this problem. Can some one explain this to me?