HELP IN MINSUBAR

help
c-plus-plus
explain

#1

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?