Bin packing algorithm?
Although to be honest this doesn't feel like one of the more complicated algorithms. Couldn't it be solved by simply looping through each teacher from (assuming 10 teachers) 1 to 10, then from 10 to 1, then 1 to 10, etc, assigning the highest remaining value?