Basic solution (always assign tasks with high duration to elfs with high productivity, and vise versa)