Assignment Problem - multiple tasks, but only one chosen based on their preference (cost)
This can be reduced to minimum-cost flow, for which there are polynomial-time  algorithms.

Build a bipartite graph, with one vertex on the left for each agent, and one vertex on  the right for  each instance of a task.  Tasks are duplicated according to the maximum number of agents they can be assigned to.  For example, if task $i$ can be assigned up to 5 agents, then there will be 5 vertices on the right corresponding to task $i$.  If agent $i$ has a cost of $c_{i,j}$ for task $j$, add an edge of cost $c_{i,j}$ and capacity 1 from the vertex for agent $i$ to each vertex for task $j$.

Also, add a source vertex and an edge of cost 0 and capacity 1  from the source to each left vertex; and add a sink vertex and an edge of cost 0 and capacity 1 from each right vertex to the sink.  Now, find the minimum-cost flow that sends at least $n$ units of flow from the source to the sink, where $n$ is the number of agents.  That will be the solution to your problem.

There are many algorithms for solving minimum-cost flow problems, and even some off-the-shelf tools.  See Wikipedia for some references that will get you started to learn more.