given x and y (the field dimensions) and x*y numbers, (pieces of cheese on each square) calculate the best way for the mouse to get from (1, 1) to (x, y), he has to get as many cheese as possible... also you can only move closer to the (x, y) (so he couldn't eat the whole field).

i tried going through a row while it's sum is higher than the column's and switching them that way but i kinda failed... is there an efficient algorithm to solve this problem? ...i'd just like a clue

0