Problem 3443 · Medium

Maximum Manhattan Distance After K Changes

For each diagonal corner, count moves that point toward it and moves that point away; each change can turn one away-move into a toward-move, adding 2 to the distance.

Open the interactive visualisation