Division and treatment method to solve the round robin problem code