A company needs to fly people to two cities, to each city. Person costs to fly to city A and to city B. Minimize total cost. For , send persons and to A, persons and to B. Total: .
Think about the cost difference between sending someone to A versus B. Constraint: exactly people must go to each city.
If you send fewer than to city A, you violate the requirement. The cost array has two elements per person, representing the two choices. The greedy insight is to sort by opportunity cost, not absolute cost.