Problem 1029 · Medium

Two City Scheduling

Send exactly half of the people to each city so the total cost is as low as possible. People are ordered by how much more one city costs than the other, and the cheapest switches fill each side.

Open the interactive visualisation