Optimal task assignments for group performance