Problem 2561 · Hard

Rearranging Fruits

Mismatched fruit pairs are swapped at the cheaper of their two costs, or routed through the cheapest fruit overall when that is cheaper.

Open the interactive visualisation