Hi Brio,
Iterating over the list of tasks would be a nice approach. What to do next depends on your case. Do you want to divide all tasks equal on your users? So every user has only one task at the moment. Then you need to retrieve one user, who isn't assigned to a task yet and associate it to the current task. Continue this till you handled all tasks.
You can accomplish this on many ways, but it's depends on how you want to assign the tasks to the users.