Order teleport pads around a circle so that the total mismatch between each pad and where its neighbour teleports is as small as possible, breaking ties lexicographically.
Order teleport pads around a circle so that the total mismatch between each pad and where its neighbour teleports is as small as possible, breaking ties lexicographically.
Opens with the full question.