There are n people in a queue for k gondolas. Some pairs know each other. If two people who know each other share a gondola, they talk (cost 1). Assign people to gondolas in queue order to reduce total talking. Each gondola needs at least one person.
This is partitioning: split n people into k contiguous groups, reducing sum of pair-costs within groups. Before reading the solution, try to identify the base case and recursive relationship yourself.