Arranging teams in a programming competition | CodeChef